Algar Posted July 23, 2003 Posted July 23, 2003 I am have the following code: Dim Conn As OleDb.OleDbConnection Dim sConn = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & _ System.Windows.Forms.Application.ExecutablePath & "\db.mdb" Conn.ConnectionString = sConn Conn.Open() This I figured out on my own just playing with things. Seems like I have created a connection object, set the connection parameters and opened the connection. Now I can't for the life of me find how to create a recordset or query the database at all. These simple functions are what I really need right now, but also if anyone has a website (other then msdn, which has already confused me enough for a lifetime) that covers all these basics it would be greatly appreciated, thank you. Quote
*Experts* mutant Posted July 23, 2003 *Experts* Posted July 23, 2003 The next thing you need is the command that will be executed in the database, something like: Dim dbCmd As New OleDb.OleDbCommand("command text goes here", Conn) First the command that will be executed, like: SELECT columnname FROM tablename And then you provide the connection that will be used. The next thing you have to do is execute the command. If the command returns results (like the one I showed above) you use the ExecuteReader class to get the data to the OldDBDataReader. If you query doesnt return anything, like a querty that inserts data then you execute the command with the ExecuteNonQuery method. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.