|
-
Mar 27th, 2000, 08:29 PM
#1
Thread Starter
Hyperactive Member
Hi gang,
Is there anyway I can connect to a table created in the above version of Access? I'm trying to connect via the data control and it says that the database is corrupted or is not an Access database.
Any idea?
Thanks much 
JazzBass
JazzBass
In the .NET era
Trying to remember VB6
Progress: 
XP Professional @ Home
and @ the Office
-
Mar 27th, 2000, 08:47 PM
#2
Lively Member
You are probably trying to connect to a version of a database that was released after the ADO. You might have to code your connection the "manual" way. Just a hunch.
-
Mar 27th, 2000, 08:55 PM
#3
New Member
Are you sure that the control is pointing to the database??
if so then why not try an SQL statment like
DIM dbs as database, rst as recordset
set dbs = opendatabase("c:\mydb.mdb")
set rst = dbs.openrecordset _
("SELECT column1, column2 " _
"FROM tbltable;" _
or if you wanted to you could also make a condition like
set rst = dbs.openrecordset _
("SELECT column1, column2 " _
"FROM tbltable " _
"WHERE column1 = 'whatever' " _
"OR column2 = '" & a varable & "';")
dbs.close
-
Mar 27th, 2000, 10:47 PM
#4
Thread Starter
Hyperactive Member
Thanks! Another question
Thanks for the input,
I figured it would be something that is beyond what I know about databases.
I have another question regarding how to post query results in Office 97 VBA
Here is my code:
Code:
Sub cmdUpdate_Click()
Dim dbs As Database, rst As Recordset
Dim strVariable As String
strVariable = Forms!StateSelectNew.cmbStateSelect
strSQL = "SELECT DISTINCT * FROM OTC_SITES WHERE [SITE_STATE] = " & "'" & strVariable & "'"
Set rst = dbs.OpenRecordset(strSQL)
Set dbs = Nothing
End Sub
After the query runs, I don't get any feedback.
Any ideas?
Thanks
Jazzbass
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|