473,382 Members | 1,447 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,382 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 1742
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: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.