Phillip,

Thanks again for pointing out the documentation error in open for db's. 

-  On Postgresql the 4 parameter open fails.  The 5 parameter one works.

-  Excel/ODBC appears to be more tolerant in this regard.

It would also appear that I need to know the name of a system table to get the names of tables in the database for postgres.  Not sure how it works for other interfaces.  This makes the function to return table names a bit non-generic.


David

David Gamey <[EMAIL PROTECTED]> wrote:
Phillip,

This isn't the problem.  At this point I'm trying to get a list of tables from the connection.  I don't have a table name to provide.  I would expect to need a name when I open a table though.

The test program and output show what happens when I try both approaches.  Look for the FAILS HERE.

There is an excel workbook associated with ODBC_Tests and it has a "Root" worksheet in it.

I believe it goes back to the how the call has been coded at a low level.

Thanks
David

-----------------
link ximage
procedure main(arglist)
write(&version)
every dbn := !["ODBC_Tests","ODBC_Test_T","MDB Test"] do {
   write("\n++ Opening db connector: ",image(dbn))

   dbtestinfo( dbn,"o","",""  )
   dbtestinfo( dbn,"o","Root","","")
}
end

procedure dbtestinfo(x[])
   write("++ open of \n:",ximage(x))
   dbf := open!x  | stop("Unable to open db ")
   write("getting table info:")
   write("++ Driver Info:\n",ximage(dbdriver(dbf)))
   write("++ Product Info:\n",ximage(dbproduct(dbf)))
   write("++ Table Info:   <<<< FAILS HERE >>>>\n",ximage(dbtables(dbf)))
   write("++ Closing connector ",image(dbf))
   close(dbf)
return
end
------------------------------------------
Unicon Version 11.3 (beta).  June 23, 2005

++ Opening db connector: "ODBC_Tests"
++ open of
:L3 := list(4)
   L3[1] := "ODBC_Tests"
   L3[2] := "o"
   L3[3] := ""
   L3[4] := ""
getting table info:
++ Driver Info:
R__1 := ()
   R__1.name := "odbcjt32.dll"
   R__1.ver := "04.00.6304"
   R__1.odbcver := "03.51"
   R__1.connections := 0
   R__1.statements := ""
   R__1.dsn := "ODBC_Tests"
++ Product Info:
R__1 := ()
   R__1.name := "EXCEL"
   R__1.ver := "08.00.0000"
++ Table Info:   <<<< FAILS HERE >>>>
L9 := list(0)
++ Closing connector file(ODBC_Tests)
++ open of
:L12 := list(5)
   L12[1] := "ODBC_Tests"
   L12[2] := "o"
   L12[3] := "Root"
   L12[4] := ""
   L12[5] := ""
getting table info:
++ Driver Info:
R__2 := ()
   R__2.name := "odbcjt32.dll"
   R__2.ver := "04.00.6304"
   R__2.odbcver := "03.51"
   R__2.connections := 0
   R__2.statements := ""
   R__2.dsn := "ODBC_Tests"
++ Product Info:
R__2 := ()
   R__2.name := "EXCEL"
   R__2.ver := "08.00.0000"
++ Table Info:   <<<< FAILS HERE >>>>
L19 := list(0)
++ Closing connector file(ODBC_Tests)

++ Opening db connector: "ODBC_Test_T"
++ open of
:L22 := list(4)
   L22[1] := "ODBC_Test_T"
   L22[2] := "o"
   L22[3] := ""
   L22[4] := ""
getting table info:
++ Driver Info:
R__3 := ()
   R__3.name := "odbcjt32.dll"
   R__3.ver := "04.00.6304"
   R__3.odbcver := "03.51"
   R__3.connections := 0
   R__3.statements := ""
   R__3.dsn := "ODBC_Test_T"
++ Product Info:
R__3 := ()
   R__3.name := "EXCEL"
   R__3.ver := "08.00.0000"
++ Table Info:   <<<< FAILS HERE >>>>
L28 := list(0)
++ Closing connector file(ODBC_Test_T)
++ open of
:L31 := list(5)
   L31[1] := "ODBC_Test_T"
   L31[2] := "o"
   L31[3] := "Root"
   L31[4] := ""
   L31[5] := ""
getting table info:
++ Driver Info:
R__4 := ()
   R__4.name := "odbcjt32.dll"
   R__4.ver := "04.00.6304"
   R__4.odbcver := "03.51"
   R__4.connections := 0
   R__4.statements := ""
   R__4.dsn := "ODBC_Test_T"
++ Product Info:
R__4 := ()
   R__4.name := "EXCEL"
   R__4.ver := "08.00.0000"
++ Table Info:   <<<< FAILS HERE >>>>
L38 := list(0)
++ Closing connector file(ODBC_Test_T)
--------------------

++ Opening db connector: "MDB Test"
++ open of
:L41 := list(4)
   L41[1] := "MDB Test"
   L41[2] := "o"
   L41[3] := ""
   L41[4] := ""
getting table info:
++ Driver Info:
R__5 := ()
   R__5.name := "odbcjt32.dll"
   R__5.ver := "04.00.6304"
   R__5.odbcver := "03.51"
   R__5.connections := 0
   R__5.statements := ""
   R__5.dsn := "MDB Test"
++ Product Info:
R__5 := ()
   R__5.name := "ACCESS"
   R__5.ver := "04.00.0000"
++ Table Info:   <<<< FAILS HERE >>>>
L47 := list(0)
++ Closing connector file(MDB Test)
++ open of
:L50 := list(5)
   L50[1] := "MDB Test"
   L50[2] := "o"
   L50[3] := "Root"
   L50[4] := ""
   L50[5] := ""
getting table info:
++ Driver Info:
R__6 := ()
   R__6.name := "odbcjt32.dll"
   R__6.ver := "04.00.6304"
   R__6.odbcver := "03.51"
   R__6.connections := 0
   R__6.statements := ""
   R__6.dsn := "MDB Test"
++ Product Info:
R__6 := ()
   R__6.name := "ACCESS"
   R__6.ver := "04.00.0000"
++ Table Info:   <<<< FAILS HERE >>>>
L57 := list(0)
++ Closing connector file(MDB Test)







David

Phillip <[EMAIL PROTECTED]> wrote:

David,
The documentation in the programming book is wrong by one parameter for
the open(). Look at: ./uni/lib/db.icn for the full form.

This file, if linked, will allow a 4-parameter call through the dbopen
call:

procedure dbopen(dsn,table,user,password)
return open(dsn,"o",table,user,password)
end

Phillip

On Tue, 31 Oct 2006, David Gamey wrote:

> Phillip,
>
> I gather that you are refering to the low level call to open the odbc connection rather than the call at the Unicon soure level. (The documentation of the Unicon call to open only shows 4 parameter.)
>
> I haven't had time to delve under the covers yet. But this could be helpful.
>
> Thanks,
>
> David

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Unicon-group mailing list
Unicon-group@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/unicon-group

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642_______________________________________________
Unicon-group mailing list
Unicon-group@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/unicon-group

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Unicon-group mailing list
Unicon-group@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/unicon-group

Reply via email to