|
-
Jan 6th, 2005, 07:27 PM
#1
Thread Starter
Hyperactive Member
INSERT in commandtext
This are my field in my MDB file:
Field Name Data Type Description
===========================================================
c_id AutoNumber Customer ID [Primary Key]
c_date Date/Time Current Date [Now]
c_name Text Customer Name [TextBox1.Text]
c_mail Text Customer Email [TextBox2.Text]
===========================================================
The only field that I have to update are the "c_name" and "c_mail". And I use this code;
Dim cn As New OleDbConnection
Dim cm As New OleDbCommand("INSERT INTO table1 VALUES('" & TextBox1.Text & "','" & TextBox2.Text & "'")
Dim rd As OleDbDataReader
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; data source=D:\my.mdb"
cn.Open()
cm.Connection = cn
rd = cm.ExecuteReader()
cn.Close()
But this code doesn't work.. Kindly correct this code for me?? What code should I write??
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|