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

Linking Access2000 with VB6(i'm loosing my mind) 2

Status
Not open for further replies.

Monzer

Programmer
May 24, 2002
26
0
0
CA
I have a data base in a perfect performance on a network and i need to secure the data base on VB6 by linking them because i dont want users to be able to browse through my tables and querys, i want them only to use some forms.
I tried to link the DBase to VB by using the VB data wisard, and all i'm getting is "Unreconized data base format" so please help me.
Thank you
 
What is the database you are using?
Access2000 in the title but then you mention DBase
You can connect VB to Access2000 or Access97.
Which format are you trying to support?
 
In order for you to read an Access 2000 database in VB6 you must have Visual Studio service pack 5 installed unless you use Jet 4.0.

You can get it at microsofts web site...
 
you can also use the Access 2000 Database conversion tools to "convert to previous version of Access" (I choose '97) and save (you must save as a different name since it is a different file) (unless you are saving in a different directory). I usually save the 2000 and the '97 in the same dir for simplicity and name the 2000 database and the '97 the same, (ie Access 2000="database.mdb"; Access '97="database-vb.mdb").


[pc3]
 
Try this :

Code:
'Make a reference to
'Microsoft ActiveX Data Object 2.5 Library 
'Microsoft ADO Ext. 2.5

Dim cnn As ADODB.Connection
Dim rst As ADODB.Recordset
Dim cnnStr As String
Dim Query As String

'This will let you connect to your database.
cnnStr = "Provider=Microsoft.Jet.OLEDB.4.0;" & 
         &quot;Data Source=<Full path of your Database>&quot;
Set cnn = New ADODB.Connection
cnn.Open cnnStr

'You will be able to perform many SQL queries...
Query = &quot;Select * From <YourTable>&quot;
Set rst = cnn.Execute(Query)
<TextBox1> = rst.Fields(<Idx>).Value

Query = &quot;Insert Into <YourTable>.......&quot;
cnn.Execute Query

...

cnn.Close

...
 
Hi. Add DAO 3.6 to your project references and you will be able to connect to the Access 2000 Tables.
 
>Add DAO 3.6 to your project references and you will be able to connect to the Access 2000 Tables

hookbob, this was already mentioned above (The reference to JET 4 can only be used by DAO 3.6, if DAO at all, or, for ADO, the JET provider).

Not only that, if you use the Data Control, and haven't updated, adding a reference to DAO 3.6 will not help at all....

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top