By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,660 Members | 1,127 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,660 IT Pros & Developers. It's quick & easy.

inserting onto Ms access using vb.NEt

P: n/a
nsj
how to insert records in table1 of db1.mdb of MsAccess using Vb.NET
Nov 22 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Add a System DSN called myAccessDb (or whatever) that points to your MsAccess
database using the ODBC Data Source Administrator.

imports System.Data.Odbc

dim connOdbc as new odbcconnection
dim cmdOdbc as new odbccommand
dim nRowsAffected as integer

connOdbc.ConnectionString = "DSN=myAccessDb;"
connOdbc.Open()
cmdOdbc.Connection = connOdbc
cmdOdbc.CommandText = "INSERT INTO tablename (col1, col2) VALUES (1, 2);"
nRowsAffected = cmdOdbc.ExecuteNonQuery()
connOdbc.Close()
"nsj" wrote:
how to insert records in table1 of db1.mdb of MsAccess using Vb.NET

Nov 22 '05 #2

P: n/a
Add a System DSN called myAccessDb (or whatever) that points to your MsAccess
database using the ODBC Data Source Administrator.

imports System.Data.Odbc

dim connOdbc as new odbcconnection
dim cmdOdbc as new odbccommand
dim nRowsAffected as integer

connOdbc.ConnectionString = "DSN=myAccessDb;"
connOdbc.Open()
cmdOdbc.Connection = connOdbc
cmdOdbc.CommandText = "INSERT INTO tablename (col1, col2) VALUES (1, 2);"
nRowsAffected = cmdOdbc.ExecuteNonQuery()
connOdbc.Close()
"nsj" wrote:
how to insert records in table1 of db1.mdb of MsAccess using Vb.NET

Nov 22 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.