Here is the entire SQL:
Dim myConnString
Dim myConnection
Dim mySQL1
Dim mySQL2
Dim myRs
Dim myID1
Dim myID2
myConnString = Application
("pbbalancing_ConnectionString")
Set myConnection = Server.CreateObject
("ADODB.Connection")
myConnection.Open myConnString
Dim
myDrawer,myBegCash,myCashIn,myCashOut,myEndCash,mytotalcash
,mylongshort,myBalancingDate,myInputBy
myDrawer = Request.Form("Drawer")
myBegCash = Request.Form("BegCash")
myCashIn = Request.Form("CashIn")
myCashOut = Request.Form("CashOut")
myEndCash = Request.Form("EndCash")
mytotalcash = Request.Form("totalcash")
mylongshort = Request.Form("longshort")
myBalancingDate = Request.Form("BalancingDate")
myInputBy = Request.Form("InputBy")
myID1=Request.Form("Drawer")
myID2=Request.Form("BalancingDate")
mySQL1 = "UPDATE cashdrawer SET begcash = '"&_
Request.Form("BegCash") &_
"',cashin = '"&Request.Form
("CashIn") &_
"',cashout
= '"&Request.Form("CashOut") &_
"',endcash
= '"&Request.Form("EndCash") &_
"',totalcash
= '"&Request.Form("totalcash") &_
"',longshort
= '"&Request.Form("longshort") &_
"',datetime
= '"&Request.Form("BalancingDate") &_
"',inputby
= '"&Request.Form("InputBy") &_
"' WHERE drawer = " &
myID1'" AND datetime = " & myID2
myConnection.Execute(mySQL1)
"drawer" is text string & "datetime" is Date format.
ID1 & ID2 are text boxes from input form.
I'm also interested in determining if no record is updated
with this SQL1. Thank you.>
-----Original Message-----
I'm afraid that nobody can tell you if it is correct. What you posted is a
portion of a string declaration, which contains several variables
concatenated into it. Whether it's correct or not depends on several
factors:
1. What are the values of the variables?
2. What are the data types of the database columns that they are being used
with?
I CAN tell you that your string declaration is missing at least one "&"
character, between [& myID1'] and [" AND ..."], as well as the fact that the
single quote next to the variable name [ID1] is going to throw an error.
As for your second question, please define "item" and "not found" (as in
"not found by ...")
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
Stu said:
Can anyone tell me if this statement is correct??
This is part of an UPDATE statement
"' WHERE drawer = " & myID1'" AND datetime = " & myID2
Also, How can I test to see if item was "not found"???
Thank you very much.
.