Unix Technical Forum

odbc connect string and library list

This is a discussion on odbc connect string and library list within the DB2 forums, part of the Database Server Software category; --> I am trying to write an app in vfp 8.0 using cursoradapters connecting to an as400 db2 database. My ...


Go Back   Unix Technical Forum > Database Server Software > DB2

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 07:30 AM
Fred
 
Posts: n/a
Default odbc connect string and library list

I am trying to write an app in vfp 8.0 using cursoradapters connecting
to an as400 db2 database. My goal is to set up a test data library
(called FRED) on the iseries identical to the production data library
and manipulate the library list the pc uses by changing the odbc
connection string. If my understanding is correct, the DBQ option of
the connection string adds libraries to the lib list, but I can't get
the cursor to load unless I qualify the table name with the library
name.

I also can not find any good documentation on IBM Access for Windows
ODBC properties but have found this one for LINUX(which is what I'm
going by).
http://www-03.ibm.com/servers/eserve...roperties.html

Thanks in advance.
Here's my code:

lcConnStr= "DRIVER={iSeries Access ODBC Driver};" ; +
"PKG=QGPL/DEFAULT(IBM),2,0,1,0,512;" ;
+ "LANGUAGEID=ENU;" ;
+ "DFTPKGLIB=QGPL;" ;
+ "XDYNAMIC=1;" ;
+ "DBQ=QGPL,FRED;" ;
+ "SYSTEM=SCCA400;" ;
+ "Trusted Connection=Yes;"

retval = SQLSTRINGCONNECT(lcConnStr)

<This doesn't work>
select PERCENT, NAME, ADDRESS1, TAXID, CHECKCODE, HOLDFUND, LLORDSWT,
REBATEAMT, ADDRESS2, CITY, STATE, ZIP, ZIPEXT, UPDSWT, CROPYR,
CONTRACT, SUB, IDNO from CPARTNERS

<This works>
select PERCENT, NAME, ADDRESS1, TAXID, CHECKCODE, HOLDFUND, LLORDSWT,
REBATEAMT, ADDRESS2, CITY, STATE, ZIP, ZIPEXT, UPDSWT, CROPYR,
CONTRACT, SUB, IDNO from FRED.CPARTNERS

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 07:30 AM
Gert van der Kooij
 
Posts: n/a
Default Re: odbc connect string and library list

In article <1143155562.569830.49710@g10g2000cwb.googlegroups. com>,
fredb2220022@yahoo.com says...

> + "DBQ=QGPL,FRED;" ;
> + "SYSTEM=SCCA400;" ;
> + "Trusted Connection=Yes;"
>


The docs say:
Note, the first library listed in this property will also be the default
library, which is used to resolve unqualified names in SQL statements.
To specify no default library, a comma should be entered before any
libraries.

So I guess you need to change the DBQ option to 'DBQ=FRED,QGPL;'
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-27-2008, 07:30 AM
Fred
 
Posts: n/a
Default Re: odbc connect string and library list

Thanks, that solved the problem.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:52 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com