openRecordset

  • Thread starter Thread starter Mirna
  • Start date Start date
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
 
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.
 
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


.
 
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).
 
Back
Top