473,395 Members | 1,442 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,395 software developers and data experts.

Simple question about insert a record.

Hello,

i am working in an ASP.net / VB web site.
I have a form.

Does anyone knows a script to insert the form values in an Access Database?

I was looking and looking and i couldn't find anything.

Thank You,
Miguel
Nov 18 '05 #1
2 1072
hi
this is a simple example of inserting into MS Access. Hope it help
http://www.dotnetspider.com/Technology/KBPages/259.asp
the bes
srini
Nov 18 '05 #2
Hi Miguel Dias Moura,
here is the script.

Try
DBConnection = New OleDbConnection( _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=d:\eCommerce\Databases\eCommerce.mdb")
DBConnection.Open()
SQLString = "INSERT INTO Products " & _
"(ItemNumber, ItemType, ItemSupplier, ItemName, " & _
"ItemDescription, ItemPrice, ItemQuantity) " & _
"VALUES (" & _
"'" & ItemNumber.Text & "', " & _
"'" & ItemType.SelectedItem.Value & "', " & _
"'" & Replace(ItemSupplier.Text, "'", "''") & "', " & _
"'" & Replace(ItemName.Text, "'", "''") & "', " & _
"'" & Replace(ItemDescription.Text, "'", "''") & "', " & _
ItemPrice.Text & ", " & _
ItemQuantity.Text & _
")"
DBCommand = New OleDbCommand(SQLString, DBConnection)
DBCommand.ExecuteNonQuery
DBConnection.Close()
AddMessage.Text = "Record added"
Catch
AddMessage.Text = "Update problem. Record not added. " & SQLString
End Try

HTH
Regards
Ashish M Bhonkiya
"Miguel Dias Moura" <we****@27NOSPAMlamps.com> wrote in message
news:OF**************@TK2MSFTNGP11.phx.gbl...
Hello,

i am working in an ASP.net / VB web site.
I have a form.

Does anyone knows a script to insert the form values in an Access Database?
I was looking and looking and i couldn't find anything.

Thank You,
Miguel

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Pete | last post by:
Does anyone have a simple html vbscript or other type of snippet they can share that appends a record to a access database via ADO or DAO? I would like to allow users that don't have Microsoft...
4
by: olafmol | last post by:
Hello, i am wondering if there is a simple way to insert a new record into an MS Access db and read out the newly created auto-ID field. Using ASP this was rather simple, but in ASP.NET (VB) it...
3
by: Shapper | last post by:
Hello, I have created 3 functions to insert, update and delete an Access database record. The Insert and the Delete code are working fine. The update is not. I checked and my database has all...
2
by: Deano | last post by:
Problem is that there are lots and lots of fields in an employee record. I specify a form control as the criterion for one of those fields which is the value of the primary key for that record. ...
1
by: E.T. Grey | last post by:
I have been busting my nut over this for pretty much most of the day and it is driving me nuts. I posted this to an mySQL ng yesterday and I have not had any response (I'm pulling my hair out...
7
by: Materialised | last post by:
Hi Folks, Just a quickie, I am inserting some records (individually) into a SQL Server Table. I am wondering how can I detect primary key violations on this data which I am inserting into the...
8
by: MLH | last post by:
I would like to modify the following SQL... INSERT INTO tblPmtsRcd (VehicleJobID, PmtAmt) SELECT GetCurrentVehicleJobID() AS MyVehicleJobID, !! AS MyPmtAmt; somehow so that an extra field in...
10
by: oracle newbie | last post by:
How to create a pl sql program which enable to insert record into database? Can anyone can give details or steps in creating a pl sql program which enable to insert record into database using the...
0
by: Caper | last post by:
Hello everyone, I am a bit confused about Innodb deadlock and the "SELECT…FOR UPDATE” statement. 1. Here is a deadlock example 1) Create actor table CREATE TABLE actor(actor_id INT...
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
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
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,...
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...

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.