How do I connect to a database on the server or "unsecure" internet site. I have tried the following and it works if I hard code a "C:\*.mdb" but when I place it does not work. SEE CODE BELOW
Any suggestions on how to access a Database using http????
Dim MyConnstr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Database.mdb;Persist Security Info=False"
'THIS DOES NOT WORK BELOW
'Dim MyConnstr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Localhost/Database.mdb/; Persist Security Info=False"
'THIS DOES NOT WORK ABOVE
Dim strSQL As String = "Select * from Customers"
Dim cnn As OleDbConnection = New OleDbConnection(MyConnStr)
' Dim cmd As OleDbCommand = New OleDbCommand(strSQL, cnn)
Dim dr As DataRow
Dim ds As DataSet = New DataSet()
Dim da As OleDbDataAdapter = New OleDbDataAdapter()
da.SelectCommand = New OleDbCommand(strSQL, cnn)
da.Fill(ds)
DataGrid1.DataSource = ds
da.Dispose()
cnn.Close()
Any suggestions on how to access a Database using http????
Dim MyConnstr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Database.mdb;Persist Security Info=False"
'THIS DOES NOT WORK BELOW
'Dim MyConnstr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Localhost/Database.mdb/; Persist Security Info=False"
'THIS DOES NOT WORK ABOVE
Dim strSQL As String = "Select * from Customers"
Dim cnn As OleDbConnection = New OleDbConnection(MyConnStr)
' Dim cmd As OleDbCommand = New OleDbCommand(strSQL, cnn)
Dim dr As DataRow
Dim ds As DataSet = New DataSet()
Dim da As OleDbDataAdapter = New OleDbDataAdapter()
da.SelectCommand = New OleDbCommand(strSQL, cnn)
da.Fill(ds)
DataGrid1.DataSource = ds
da.Dispose()
cnn.Close()