Full House
New member
- Joined
- Dec 12, 2007
- Messages
- 3
- Programming Experience
- Beginner
Hello -
I am using an Access database (2003) to store data - well not actually yet as I am unable to get the connection to work properly - and am having difficulty doing so. Here is what I have:
All of the values are String - but for some reason it is failing? Maybe I am using the wrong syntax, but I'm pretty new to programming so if you see my error please let me know![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
thanks
I am using an Access database (2003) to store data - well not actually yet as I am unable to get the connection to work properly - and am having difficulty doing so. Here is what I have:
VB.NET:
Dim connection As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\dummy\Desktop\Database stuff\DatabaseExample\bin\Debug\db1.mdb;")
Dim command As New OleDb.OleDbCommand("INSERT INTO Orders (CustomerName, Quantity, Size) VALUES (@CustomerName, @Quantity, @Size)", connection)
command.Parameters.AddWithValue("@CustomerName", clientDescriptionTable)
command.Parameters.AddWithValue("@Quantity", qtyTable)
command.Parameters.AddWithValue("@Size", pprSize)
connection.Open()
command.ExecuteNonQuery()
connection.Close()
All of the values are String - but for some reason it is failing? Maybe I am using the wrong syntax, but I'm pretty new to programming so if you see my error please let me know
thanks