Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening a recordset in VBA on an SQL srv table with Unique Identifier

Status
Not open for further replies.

AmeriSource

Programmer
Dec 3, 2001
17
CA
I am trying to open a recordset on a sql server table threw vba and it keeps telling me that i have to use the dbseechanges option. When i do use the dbseechanges option it still tells me that i have to use the dbseechanges option.

Thank you in advance,

Frank
 
Can you please post a representative sample of your code?
(Not 2000 lines worth, just the relevant portion please).

Chip H.
 
This is a sample of what i'm trying to do:

set db=currentdb()
set rstInvoice=db.openrecordset("tblInvoice",,dbseeChanges)

*It's very simple the only thing is, is that tblInvoice has an autonumber id.
 
Doesn't this mean you're going through Microsoft Access?

set db=currentdb()
 
Yes, I am using Microsoft access to access this sql table.
 
I think you would be better off using a connection string and going against the SQL Server database directly.
 
hi m8

i have used this functionality a lot with linked tables and manipulating it with code

here is some of what i have had working b4 and that is with autonumbers
[tt]
Dim findcar As Recordset
Dim db4 As Database
Set db4 = currentdb()
Set findcar = db4.OpenRecordset("tblwhatever", , dbSeeChanges)
[/tt]
Do u get there error when u just make a conection ( like the above does) or when u try to change the data?

Joe
 
Did anyone ever help you with this? I was having the same exact problem. I found out that I had to also explicitly say it was a dynaset, too. Saying dbseechanges by itself didn't cut it. Try this:
Set rst = CurrentDb.OpenRecordset("mytable", dbOpenDynaset, dbSeeChanges)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top