Good Morning everyone....Normally I use the following to connect to the database so it's not hard coded.
XXX "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "SS2X.MDB;Persist Security Info=False"
This is returning an error in Visual Basic 2005 which I am just beginning to learn...
Below is a sample of a connection to vb2005 which does work , so how do you change the path so that is is the applications path and not hard coded to the C drive....Jamie
____________________________________________________________
Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
m_cnADONetConnection.ConnectionString = _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:Documents and SettingsXtremeblueDesktopTYVB2005SamplesHour
21contacts.mdb"
m_cnADONetConnection.Open()
New OleDb.OleDbDataAdapter("Select * From Contacts", m_cnADONetConnection)
New OleDb.OleDbCommandBuilder(m_daDataAdapter)
m_daDataAdapter.Fill(m_dtContacts)
Me.ShowCurrentRecord()
End Sub