TheWizardofInt
Well-known member
Anyone see a problem with this? I am writing to a simple Access database
Client = String (all strings are 50)
sDate = Date/Time
Gross= Currency
Net=Currency
Product = String
Developer = String
Hours = Long Integer
Paid = Boolean
Client = String (all strings are 50)
sDate = Date/Time
Gross= Currency
Net=Currency
Product = String
Developer = String
Hours = Long Integer
Paid = Boolean
Code:
sSQL = "UPDATE [Sales] SET [Client]=@Client, [SDate]=@SDate, [Gross]=@Gross," & _
" [Net]=@Net, [Product]=@Product, [Developer]=@Developer, [Hours]=@Hours, [Paid]=@Paid"
Try
oConn = New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; " & _
"Data Source=" & sPath & ";")
oConn.Open()
cmd = New OleDb.OleDbCommand
cmd.Parameters.Add(New OleDb.OleDbParameter("@SDate", System.Data.OleDb.OleDbType.DBDate, 8))
cmd.Parameters("@SDate").Value = CDate(txtDate.Text)
cmd.Parameters.Add(New OleDb.OleDbParameter("@Client", System.Data.OleDb.OleDbType.Char, 50))
cmd.Parameters("@Client").Value = txtClient.Text
cmd.Parameters.Add(New OleDb.OleDbParameter("@Gross", System.Data.OleDb.OleDbType.Currency, 8))
cmd.Parameters("@Gross").Value = Val(txtCost.Text)
cmd.Parameters.Add(New OleDb.OleDbParameter("@Net", System.Data.OleDb.OleDbType.Currency, 8))
cmd.Parameters("@Net").Value = Val(txtRate.Text)
cmd.Parameters.Add(New OleDb.OleDbParameter("@Product", System.Data.OleDb.OleDbType.Char, 50))
cmd.Parameters("@Product").Value = txtProduct.Text
cmd.Parameters.Add(New OleDb.OleDbParameter("@Developer", System.Data.OleDb.OleDbType.Char, 50))
cmd.Parameters("@Developer").Value = cmbDeveloper.Text
cmd.Parameters.Add(New OleDb.OleDbParameter("@Hours", System.Data.OleDb.OleDbType.Numeric, 8))
cmd.Parameters("@Hours").Value = Val(txtHours.Text)
cmd.Parameters.Add(New OleDb.OleDbParameter("@Paid", System.Data.OleDb.OleDbType.Boolean, 1))
cmd.Parameters("@Paid").Value = b
cmd.Connection = oConn
cmd.CommandText = sSQL