473,387 Members | 1,569 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

inserting onto Ms access using vb.NEt

nsj
how to insert records in table1 of db1.mdb of MsAccess using Vb.NET
Nov 22 '05 #1
2 1743
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: nsj | last post by:
how to insert records in table1 of db1.mdb of MsAccess using Vb.NET
8
by: Evan | last post by:
If there are any enlightend souls out there that can help me, I would greatly appreciate it. I would like to use a macro to take a value and add it to an access database. I am having a problem...
7
by: Jeff Harbin | last post by:
I have an Access 2000 database which saves (exports) of copy of the main data table each time it is opened. It continually over-writes the same file so I've got a back-up if anything were to...
7
by: GaryB | last post by:
I have an untyped datatable that has financial numbers and controls that were populated by code (not a simple fill from a DA). Now I want to insert subtotals into it. I wrote a sub to do so that...
0
by: Niketa Mahana | last post by:
Hi, We are in the process of making product in windows forms that is localized presently for all european countries.We are supposed to support all eastern and western european date , time and...
12
by: Marcus Kwok | last post by:
I am not sure if this is something that is covered by the Standard, or if it's an implementation detail of my Standard Library. I am reading in a large amount of data into a std::set. There is...
2
by: mousewonders | last post by:
Hi Guys, I am very new to VB. I am working on a project for class that will let people sign in to a fitness center and sign out. I have no clue what I am doing. I have searched and read and...
18
by: hotflash | last post by:
Hi Mark et All, I understand that you created a very professional document and a similar issue forum out there regarding to Inserting the checkbox value into MS Access using ASP however; I am so...
0
by: freeskier | last post by:
Hello, Sorry for the newb question; I've spent a good amount of time trying to figure this out. I am fairly new to the Postgre world. I am currently in the process of upsizing several MS Access...
2
by: hakkatil | last post by:
Hi to all, I have a page that inserts excel sheet to access database. I am using asp. What I want to do is to check the inserting record if it is in the database. Basicly checking the dublicate...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.