473,406 Members | 2,371 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,406 software developers and data experts.

how to add items in access database using vb forms

24
hi

i am quite new with access n i don know how to add new items in the database from vb form at runtime
Aug 9 '07 #1
4 2772
hi

i am quite new with access n i don know how to add new items in the database from vb form at runtime
Dim cnn As ADODB.Connection
cnn.Open "Provider=microsoft.jet.oledb.4.0; data source=d:\Student.mdb"

cnn.Execute "insert into tblStudent(ID,name,sex,Address) values('" & txtID & "','" & txtname & "','" & txtsex & "','" & txtaddress & "')"
Aug 10 '07 #2
Dim cnn As ADODB.Connection
Dim rs As ADODB.recordset
cnn.Open "Provider=microsoft.jet.oledb.4.0; data source=d:\Student.mdb"
rs.open"select * from table",cnn,3,3

rs.addnew
rs.fields(1)=txtfield.text
rs.movenext

rs.close
cnn.close

soulfly
Aug 23 '07 #3
suvarna
24
Dim cnn As ADODB.Connection
Dim rs As ADODB.recordset
cnn.Open "Provider=microsoft.jet.oledb.4.0; data source=d:\Student.mdb"
rs.open"select * from table",cnn,3,3

rs.addnew
rs.fields(1)=txtfield.text
rs.movenext

rs.close
cnn.close

soulfly



thank you for the reply it worked...
Aug 29 '07 #4
suvarna
24
Dim cnn As ADODB.Connection
cnn.Open "Provider=microsoft.jet.oledb.4.0; data source=d:\Student.mdb"

cnn.Execute "insert into tblStudent(ID,name,sex,Address) values('" & txtID & "','" & txtname & "','" & txtsex & "','" & txtaddress & "')"



thanks a lot for your help..
Aug 29 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Wayne Wengert | last post by:
I am trying to populate a combobox with a lisy of items. I want the 1st item to be "Make a Selection" and the following items will be names from a table in my DB (See code below). When I run the...
5
by: dananrg | last post by:
I've created a small company database where the tables reside in a SQL Server database. I'm using Access 2000 forms for a front end. I've got a System DSN set-up to SQL Server and am using links...
49
by: Yannick Turgeon | last post by:
Hello, We are in the process of examining our current main application. We have to do some major changes and, in the process, are questionning/validating the use of MS Access as front-end. The...
64
by: John | last post by:
Hi What future does access have after the release of vs 2005/sql 2005? MS doesn't seem to have done anything major with access lately and presumably hoping that everyone migrates to vs/sql. ...
1
by: thomasp | last post by:
Has anyone got some sample code to do drag and drop from one listbox to another listbox using VB.Net 2005. The below code works for draging and droping one at a time, but not for multiselected...
52
by: Neil | last post by:
We are running an Access 2000 MDB with a SQL 7 back end. Our network guy is upgrading to Windows Server 2003 and wants to upgrade Office and SQL Server at the same time. We're moving to SQL Server...
34
by: Mathieu Trentesaux | last post by:
Hello I downloaded Office 2007 for this reason : It seems, once again, that it is impossible to save any modification done in a VBA library, from the main project in Access. The save button...
5
by: Andrus | last post by:
I have database containing translations. I'm creating VS 2005 WinForms application which should use this database to translate menu items to user language. I replaced lines in myform.designer.cs...
13
by: PetterL | last post by:
I writing a program where I read menu items from a file. But I have problem when I click an menu item i want it to mark that one as checked but I cant access the menu object of that item to see...
6
by: Wesley Peace | last post by:
I hate to cross post, but I've gotten no answer yet on a problem I'm having with visual studio 2008. I've created a series of forms with controls to access a Access database tables. The...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.