472,146 Members | 1,341 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,146 software developers and data experts.

Access 2000 Linked to SQL Server 2000, openRecordset error

I'm trying to access data in vba using the openrecordset command. The
data in on a SQL Server 2000 database, and I have linked tables to
that data. the Table I'm trying to access is one of these linked
tables, and my codes is as follows:

Set vRS = CurrentDb.OpenRecordset(tbl_DataCommentLog)

when this line is executed I get the error:

"Run-time error '3622':

You must use the dbSeeChanges option with OpenRecordset when
accessing a SQL Server table that has an Identity column. "

so I changed my code to:

Set vRS = CurrentDb.OpenRecordset(vSQL, , dbseeChanges)

When this is executed the following error is generated:

" Run-time error '13':

Type mismatch "

I noticed that it didn't seem to recognise the 'dbseechanges'
arguement as usual the case is correct for known expressions, yet the
's' was not captialised on the 'dbseeChanges' !!!!

Please help this is driving me potty...
Nov 12 '05 #1
5 17734
Try

Set vRS = CurrentDb.OpenRecordset(vSQL, dbOpenDynaset, dbseeChanges)

Assuming that vSQL is a valid SQL statement.

Terry

"Philippa" <ph*************@systemc.com> wrote in message
news:9c**************************@posting.google.c om...
I'm trying to access data in vba using the openrecordset command. The
data in on a SQL Server 2000 database, and I have linked tables to
that data. the Table I'm trying to access is one of these linked
tables, and my codes is as follows:

Set vRS = CurrentDb.OpenRecordset(tbl_DataCommentLog)

when this line is executed I get the error:

"Run-time error '3622':

You must use the dbSeeChanges option with OpenRecordset when
accessing a SQL Server table that has an Identity column. "

so I changed my code to:

Set vRS = CurrentDb.OpenRecordset(vSQL, , dbseeChanges)

When this is executed the following error is generated:

" Run-time error '13':

Type mismatch "

I noticed that it didn't seem to recognise the 'dbseechanges'
arguement as usual the case is correct for known expressions, yet the
's' was not captialised on the 'dbseeChanges' !!!!

Please help this is driving me potty...

Nov 12 '05 #2
Thanks for you responce, I tried what you suggested (yes vsql is a
valid SQL Statement shown below), and it still doesn't work, this time
I get the following error:

" Run-tiem error '3001':

Invalid Argument. "

vSQL = "SELECT * FROM tbl_DataCommentLog WHERE Comment_FileUID = '" &
pForm!Header_FileUID & "'"
pForm being a paramter passed into the sub using the ME in the forms
private sub event. Even when I change vSQL to be just a valid table
name e.g. "tbl_DataCommentLog" it returns the same error !

I have succesfull managed to use the openrecordset method but this was
when the table to a acces table not a linked one. I think the fact
the vb is not recognising the arguements 'dbOpenDynaset' and
'dbSeeChanges' ( I know this as usually the case of keywords is
corrected, and it wasn't for these words ), is relevant but I don't
understand why !!!!

My tables are linked via a SQL Server driver ODBC connection, is this
significant....?

Cheers Philippa

"Terry Kreft" <te*********@mps.co.uk> wrote in message news:<bn0ll6$9d0
$1@newsreaderg1.core.theplanet.net>...
Try

Set vRS = CurrentDb.OpenRecordset(vSQL, dbOpenDynaset, dbseeChanges)

Assuming that vSQL is a valid SQL statement.

Terry

"Philippa" <ph*************@systemc.com> wrote in message
news:9c**************************@posting.google.c om...
I'm trying to access data in vba using the openrecordset command. The
data in on a SQL Server 2000 database, and I have linked tables to
that data. the Table I'm trying to access is one of these linked
tables, and my codes is as follows:

Set vRS = CurrentDb.OpenRecordset(tbl_DataCommentLog)

when this line is executed I get the error:

"Run-time error '3622':

You must use the dbSeeChanges option with OpenRecordset when
accessing a SQL Server table that has an Identity column. "

so I changed my code to:

Set vRS = CurrentDb.OpenRecordset(vSQL, , dbseeChanges)

When this is executed the following error is generated:

" Run-time error '13':

Type mismatch "

I noticed that it didn't seem to recognise the 'dbseechanges'
arguement as usual the case is correct for known expressions, yet the
's' was not captialised on the 'dbseeChanges' !!!!

Please help this is driving me potty...

Nov 12 '05 #3
How is vRS declared?
Terry

"Philippa" <ph*************@systemc.com> wrote in message
news:9c*************************@posting.google.co m...
Thanks for you responce, I tried what you suggested (yes vsql is a
valid SQL Statement shown below), and it still doesn't work, this time
I get the following error:

" Run-tiem error '3001':

Invalid Argument. "

vSQL = "SELECT * FROM tbl_DataCommentLog WHERE Comment_FileUID = '" &
pForm!Header_FileUID & "'"
pForm being a paramter passed into the sub using the ME in the forms
private sub event. Even when I change vSQL to be just a valid table
name e.g. "tbl_DataCommentLog" it returns the same error !

I have succesfull managed to use the openrecordset method but this was
when the table to a acces table not a linked one. I think the fact
the vb is not recognising the arguements 'dbOpenDynaset' and
'dbSeeChanges' ( I know this as usually the case of keywords is
corrected, and it wasn't for these words ), is relevant but I don't
understand why !!!!

My tables are linked via a SQL Server driver ODBC connection, is this
significant....?

Cheers Philippa

"Terry Kreft" <te*********@mps.co.uk> wrote in message news:<bn0ll6$9d0
$1@newsreaderg1.core.theplanet.net>...
Try

Set vRS = CurrentDb.OpenRecordset(vSQL, dbOpenDynaset, dbseeChanges)

Assuming that vSQL is a valid SQL statement.

Terry

"Philippa" <ph*************@systemc.com> wrote in message
news:9c**************************@posting.google.c om...
I'm trying to access data in vba using the openrecordset command. The
data in on a SQL Server 2000 database, and I have linked tables to
that data. the Table I'm trying to access is one of these linked
tables, and my codes is as follows:

Set vRS = CurrentDb.OpenRecordset(tbl_DataCommentLog)

when this line is executed I get the error:

"Run-time error '3622':

You must use the dbSeeChanges option with OpenRecordset when
accessing a SQL Server table that has an Identity column. "

so I changed my code to:

Set vRS = CurrentDb.OpenRecordset(vSQL, , dbseeChanges)

When this is executed the following error is generated:

" Run-time error '13':

Type mismatch "

I noticed that it didn't seem to recognise the 'dbseechanges'
arguement as usual the case is correct for known expressions, yet the
's' was not captialised on the 'dbseeChanges' !!!!

Please help this is driving me potty...

Nov 12 '05 #4
Dim vRS As Recordset

"Terry Kreft" <te*********@mps.co.uk> wrote in message news:<bn**********@newsreaderg1.core.theplanet.net >...
How is vRS declared?
Terry

"Philippa" <ph*************@systemc.com> wrote in message
news:9c*************************@posting.google.co m...
Thanks for you responce, I tried what you suggested (yes vsql is a
valid SQL Statement shown below), and it still doesn't work, this time
I get the following error:

" Run-tiem error '3001':

Invalid Argument. "

vSQL = "SELECT * FROM tbl_DataCommentLog WHERE Comment_FileUID = '" &
pForm!Header_FileUID & "'"
pForm being a paramter passed into the sub using the ME in the forms
private sub event. Even when I change vSQL to be just a valid table
name e.g. "tbl_DataCommentLog" it returns the same error !

I have succesfull managed to use the openrecordset method but this was
when the table to a acces table not a linked one. I think the fact
the vb is not recognising the arguements 'dbOpenDynaset' and
'dbSeeChanges' ( I know this as usually the case of keywords is
corrected, and it wasn't for these words ), is relevant but I don't
understand why !!!!

My tables are linked via a SQL Server driver ODBC connection, is this
significant....?

Cheers Philippa

"Terry Kreft" <te*********@mps.co.uk> wrote in message news:<bn0ll6$9d0
$1@newsreaderg1.core.theplanet.net>...
Try

Set vRS = CurrentDb.OpenRecordset(vSQL, dbOpenDynaset, dbseeChanges)

Assuming that vSQL is a valid SQL statement.

Terry

"Philippa" <ph*************@systemc.com> wrote in message
news:9c**************************@posting.google.c om...
> I'm trying to access data in vba using the openrecordset command. The
> data in on a SQL Server 2000 database, and I have linked tables to
> that data. the Table I'm trying to access is one of these linked
> tables, and my codes is as follows:
>
> Set vRS = CurrentDb.OpenRecordset(tbl_DataCommentLog)
>
> when this line is executed I get the error:
>
> "Run-time error '3622':
>
> You must use the dbSeeChanges option with OpenRecordset when
> accessing a SQL Server table that has an Identity column. "
>
> so I changed my code to:
>
> Set vRS = CurrentDb.OpenRecordset(vSQL, , dbseeChanges)
>
> When this is executed the following error is generated:
>
> " Run-time error '13':
>
> Type mismatch "
>
> I noticed that it didn't seem to recognise the 'dbseechanges'
> arguement as usual the case is correct for known expressions, yet the
> 's' was not captialised on the 'dbseeChanges' !!!!
>
> Please help this is driving me potty...

Nov 12 '05 #5
Not to worry, while looking in my object browser I noticed that there
was no DAO library, I made a new database and imported all my tables
and stuff, and its all working fine now. Cheers for peoples input.

ph*************@systemc.com (Philippa) wrote in message news:<9c**************************@posting.google. com>...
I'm trying to access data in vba using the openrecordset command. The
data in on a SQL Server 2000 database, and I have linked tables to
that data. the Table I'm trying to access is one of these linked
tables, and my codes is as follows:

Set vRS = CurrentDb.OpenRecordset(tbl_DataCommentLog)

when this line is executed I get the error:

"Run-time error '3622':

You must use the dbSeeChanges option with OpenRecordset when
accessing a SQL Server table that has an Identity column. "

so I changed my code to:

Set vRS = CurrentDb.OpenRecordset(vSQL, , dbseeChanges)

When this is executed the following error is generated:

" Run-time error '13':

Type mismatch "

I noticed that it didn't seem to recognise the 'dbseechanges'
arguement as usual the case is correct for known expressions, yet the
's' was not captialised on the 'dbseeChanges' !!!!

Please help this is driving me potty...

Nov 12 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

14 posts views Thread by Sudhesh Nayak | last post: by
2 posts views Thread by Brian Salentine | last post: by
reply views Thread by eroshenko | last post: by
reply views Thread by Saiars | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.