Hi everyone,
I just used the upsize wizard in Access to create a Access front end and SQL server 2000 backend with linked tables, but I am receiving an error that I can't figure out.
When I am trying to add a record into my 'Cases' linked table in the SQL server, I get a error saying: "Invalid object name" with -2147217865 as the error message.
Here is my code:
Dim testrecord As ADODB.Recordset
Dim conn As ADODB.Connection
Set conn = New ADODB.Connection
conn.ConnectionString = "Provider=sqloledb.1;" & _
"DSN=intelitrak;" & _
"UID=geir;PWD=test"
conn.Mode = adModeReadWrite
conn.Open
Set testrecord = New ADODB.Recordset
testrecord.Open "Cases", conn, adOpenKeyset, adLockOptimistic,
adCmdTableDirect -- the ERROR occurs here!!!
With testrecord
.AddNew
If Forms(stDocName)!NewReopen = "New" Then
!MasterID = NewID
IsReOpen = False
Else
....etc.
I looked all around for an answer, and I partially found a answer at Microsoft's website: http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q218/9/95.asp&NoWebContent=1
However, I do not know how to make this work. I tried to create a stored procedure, and test if that made any differance, but it still said it the it was a invalid object.
Can anyone help me?
GeirJust a shot in the dark...
What if you add dbo_ to the front of Cases|||That was not it.
I tried to put 'dbo_Cases' in my VBA code, but the same error happens.
Geir|||Sorry...mayb a post in the VB forum...
Do you have other code that connects?|||none of my code that involves adding new records to the database is working. The code that views the records, however, works perfectly.
Geir
Showing posts with label receiving. Show all posts
Showing posts with label receiving. Show all posts
Tuesday, March 20, 2012
Subscribe to:
Posts (Atom)