Need Help For Connection About VB 2005 TO Access2003
I Can't Conncect VB 2005 to Access2003
When I Click Data And Add New Connection Then I Choose MS Access Database But It Doesn't Show Browse For Me [IMG]C:\Documents and Settings\akaphoome_t\Desktop\Problem VB\1.jpg[/IMG] [IMG]C:\Documents and Settings\akaphoome_t\Desktop\Problem VB\2.jpg[/IMG]
Who Can Bring Form of Add New Connection Back
Re: Need Help For Connection About VB 2005 TO Access2003
Re: Need Help For Connection About VB 2005 TO Access2003
needforu:
You could try doing it in your code like this:
To programmatically create a connection between your application and an Access database
The following code creates an OleDbConnection object, sets the OleDbConnection.ConnectionString property, and opens the connection.
VB Code:
Public Sub ConnectToAccess()
Dim conn As New System.Data.OleDb.OleDbConnection()
' TODO: Modify the connection string and include any
' additional required properties for your database.
conn.ConnectionString = & _
"Provider=Microsoft.Jet.OLEDB.4.0;Data source=" & _
"C:\Documents and Settings\username\My Documents\dbFile.mdb"
Try
conn.Open()
' Insert code to process data.
Catch ex As Exception
MessageBox.Show("Failed to connect to data source")
Finally
conn.Close()
End Try
End Sub
Hope this help.
Good Luck