-
sql connection
i am trying to create a new sql connection
Dim mySqlConnection As New SqlConnection(conString)
what should be the value of conString if my database is C:\myDB.mdb (local)
also, can you create a DataAdapter that is not specific to a single table in the DB?
so that when I say
myDataAdapter.Fill(myDataSet)
it fills myDataSet with the entire DB, not just the single table designated by
Dim DataAdapter As New SqlDataAdapter("SELECT * FROM myTable", conString)
any answers?
-
sqlconnection is for sql server
you need to use OleDbConnection object.
here is a c# example,
Code:
public void openAccess2KDB()
{
OleDbConnection conn = null;
string strDSN = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + GlobalStuff.AccessDBPath;
conn = new OleDbConnection(strDSN);
conn.Open();
}
-
and vb example..
(NOT TESTED)
Dim conn As New Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + GlobalStuff.AccessDBPath)
conn.Open()
-
if u r using odbc
then "data source = name"