openRecordset

M

Mirna

Hello,

I have a connection ODBC betwen Access and SQL server,
When I use an openrecordset I have this warning:

you must use the dbseechanges option with OpenRecordset
when accessing a SQL server Table that has an Identity
column

My code is:
If (NulVal) Then
StrCri = "SELECT Tb_Item.ID_Item FROM Tb_Item WHERE
([ID_Forfait] is Null)"

Else
StrCri = "SELECT Tb_Item.ID_Item FROM Tb_Item WHERE
([ID_Forfait] <> Null)"
End If
Set RS = db.OpenRecordset(StrCri) '--the compiler stop
here

do you have any hint please

thanks
 
V

Van T. Dinh

If you check DAO Help on OpenRecordset, the syntax is

OpenRecordset (source, type, options, lockedits)

and you will see that dbSeeChanges is one of the value you can set for the
"options" argument above.

Check Help for all valid values you can use for "type", "options" and
"lockedits" arguments.
 
M

Mirna

Hi Van

I tryed to put it (Set RS = db.OpenRecordset(StrCri, ,
dbSeeChanges)) but I have the same message how can I
resolve it ?

Thanks

-----Original Message-----
If you check DAO Help on OpenRecordset, the syntax is

OpenRecordset (source, type, options, lockedits)

and you will see that dbSeeChanges is one of the value you can set for the
"options" argument above.

Check Help for all valid values you can use for "type", "options" and
"lockedits" arguments.

--
HTH
Van T. Dinh
MVP (Access)



Mirna said:
Hello,

I have a connection ODBC betwen Access and SQL server,
When I use an openrecordset I have this warning:

you must use the dbseechanges option with OpenRecordset
when accessing a SQL server Table that has an Identity
column

My code is:
If (NulVal) Then
StrCri = "SELECT Tb_Item.ID_Item FROM Tb_Item WHERE
([ID_Forfait] is Null)"

Else
StrCri = "SELECT Tb_Item.ID_Item FROM Tb_Item WHERE
([ID_Forfait] <> Null)"
End If
Set RS = db.OpenRecordset(StrCri) '--the compiler stop
here

do you have any hint please

thanks


.
 
V

Van T. Dinh

Is Tb_Item an ODBC Linked Table? Post the Connection String of the Table.

Check Access VB Help on the OpenRecordset Method and try different
combination of type & options to work with ODBC linked Table. Make sure you
read the Remarks section carefully (very confusing).
 

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