Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access to AS400

Status
Not open for further replies.

dugbel

Programmer
Joined
Mar 22, 2002
Messages
5
Location
AU
I am trying to connect to an As400 from Access to retrieve a recordset.
I am using:
Set ws=dbEngine.CreateWorkspace("ODBCWorkspace","","",dbUseODBC)

stDNS="Name of DNS" 'Set up using ODBC Admin aplet

Set db=ws.OpenDatabase("tempDB", , , "ODBC;DSN=" & stDNS & ";DATABASE=")

stSQL="SELECT * FROM BPCSFH.WS40;"

Set rs=db.openrecordset(stSQL, dbOpenSnapshot)

That is where it bomps out with &quot;Error:3146; 37000: [IBM][Client Access Express ODBC Driver(32-bit)][DB2/400 SQL]SQL0104 - Token ; was not valid, Valid tokens: <END-OF-STATEMENT>, &quot;

After I set the db it asks for Log-In and accepts valid Log-In but doesn't like the recordset?

Any clues??

I also found that I could not create a file DSN that worked only a System or User. That will cause problems later on when we distribute the Access application out to the branch office in Melbourne?
 
I have solved part of the problem. AS400 didn't want a semicolon at the end of the SQL.

Anyone know what I can do about the File DSN?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top