Syntax error (missing operator) in query expression 'NEXTVAL

N

New

Hi ,

I Have access Forms which are Linked with Db2 Tables .I have created
sequence called "IDV.CLIENT_SEQ" in DB2 .

I want to show the Next Sequence Value in The access form.

The Below Db2 Query is fetching the Nextval if i run sql in Command editor.
SELECT NEXTVAL for IDV.CLIENT_SEQ as Aaa FROM sysibm.sysdummy1

Same Thing i want to implement in VBA Code.

Code:
Set con = Application.CurrentProject.Connection
stSql = "SELECT NEXTVAL for [ IDV_CLIENT_SEQ ] as Aaa FROM
[sysibm.sysdummy1]"
Set Rs = CreateObject("ADODB.Recordset")
Rs.Open stSql, con, 1But i am getting the error as "Syntax error (missing
operator) in query expression 'NEXTVAL for [ IDV_CLIENT_SEQ ]'. "

Please help me.....
 
S

Stefan Hoffmann

hi,
Code:
Set con = Application.CurrentProject.Connection
stSql = "SELECT NEXTVAL for [ IDV_CLIENT_SEQ ] as Aaa FROM
[sysibm.sysdummy1]"
I'm astonished that you can run an *.adp against DB2.
Set Rs = CreateObject("ADODB.Recordset")
Rs.Open stSql, con, 1But i am getting the error as "Syntax error (missing
operator) in query expression 'NEXTVAL for [ IDV_CLIENT_SEQ ]'. "
Please help me.....
Sure your not running the command against a SQL Server?

Inspect the connection string in Application.CurrentProject.Connection.


mfG
--> stefan <--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top