Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Express Edition and Compact Edition (2005)
 How To Connect to AS400 using VB6

Author  Topic 

angelesronald
Starting Member

4 Posts

Posted - 2005-11-09 : 03:06:19
Hi All,

I had tried this connection before using ODBC to connec to AS400 using the SQL statment "SELECT * FROM TableName1 LEFT JOIN TableName2 ON fieldname1=fieldname2" but Im using the same statement but only one table to be queried and is giving me an error, I use this one :

...

strAs400="DSN=DsnName"

connAS400.Open strAS400,UserID,Password

rsAS400.activeconnection=connAS400
rsAS400.Open "SELECT * FROM TableName1 WHERE fieldDate >=" & RangeDateFr
" AND TableName1 <=" & RangeDateTo ,,adopendynamic,adlockoptimistic

...

On the above codes, I dont know what might wrong. It is giving me an error message ...SQL0104 - token fieldDate was not valid. Valid Tokens: FOR WITH FETCH...

Please help if someone knows this. I would appreciate it a lot...

God BLess and best regards,

Ronald

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-11-09 : 03:44:22
Refer this
www.ConnectionStrings.com

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

angelesronald
Starting Member

4 Posts

Posted - 2005-11-10 : 03:41:23
I did try that but it is not working...Im used to connect to AS400 before using DSN using the
SELECT * from TableName1 LEFT JOIN TableName2 ON tablename1.field1=tablename2.field1 but now I am connecting only one table using simple query but it didnt work...

I appreciate your replied and thanks a lot for this...

Ron
Go to Top of Page
   

- Advertisement -