1. You must use ADODB instead of ADOCE.
2. Specify path in that way: App.Path & "\SomeFile.mdb". This path refer to SomeFile in directory WHERE APPLICATION RUNS (WHERE IS .EXE). You can specify also subfolder, if you want to data are not in same folder with .exe (App.Path & "\Data\SomeFile.mdb") or specify absolute path ("C:\SomePath\SomeFile.mdb").
3. Here is sample code to open access database and bound TextBox to field:
Option Explicit
Dim cnSample As ADODB.Connection
Dim rsSample As ADODB.Recordset
Private Sub Form_Load()
Set cnSample = New ADODB.Connection
cnSample.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Program Files\Microsoft Visual Studio\VB98\BIBLIO.MDB;Persist Security Info=False"
cnSample.Open
Set rsSample = New ADODB.Recordset
rsSample.Open "SELECT * FROM Authors", cnSample
Set Text1.DataSource = rsSample
Text1.DataField = "Author"
End Sub
Private Sub Form_Unload(Cancel As Integer)
rsSample.Close
Set rsSample = Nothing
cnSample.Close
Set cnSample = Nothing
End Sub
Plamen Ivanov
MCSD .NET Early Achiever and MCAD .NET Charter Member (VB .NET/SQL Server 2000)
MCSD (VB 6.0/SQL Server 2000) br>
VB (.NET) - what other language do you need in the whole Universe?...