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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

access to sql server connection problem

Status
Not open for further replies.

waely

Programmer
Dec 7, 2003
227
US
hi,
we have access form front-end with access database as back-end that we converted to sql server back-end and having, I believe, connection error. this is the code where it's crashing at:
-------------------------------------------------------
Public Sub updateSiteDocs(siteID As Long, protID As Long, updateSiteMembersOnly As Boolean)
Dim rstDocs, rstEvents, rstSitePers, rstSiteDocs, rstDocList As DAO.Recordset

Dim query As String
Dim newDocID As Long
Dim docExists As Boolean
Dim tdf1, tdf2 As TableDef
Dim dbs As Database
Dim qdf As QueryDef

'On Error GoTo err_sub

Set dbs = CurrentDb()
Set tdf1 = dbs.TableDefs("DocEvents")

//below is the line that is crashing the app
Set rstEvents = tdf1.OpenRecordset(dbOpenTable)
Set tdf2 = dbs.TableDefs("Documents")
Set rstDocs = tdf2.OpenRecordset(dbOpenTable)
---------------------------------------------------------

can someone help please.

thanks in advance
 
sorry Chance but I got this error message:
---------------------------------
Run-Time error "3078"
the microsoft Jet database engine cannot find the input table or query '1'. Make sure it exist and that its name is spelled correctly.
--------------------------------
please help.............
 
ok whats the value of dbopentable , also are the back end sql tables linked into access tables or do you have a connection string in the code ?

Chance,

Filmmaker, gentlemen and read my blog at
 
the value of the dbopentable is 1 and yes all tables are linked to access.

thank you
 
I got it fixed. I replaced access dbopentable with sql Set rdbOpenDynaset and it worked. thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top