Assuming the specs shown in this thread the dbs file should allow for an update statement without a WHERE clause (to update all records in the database)
The loop that preforms the updates looks like this. (about line 440)
for y = 0 to numfields-1
if Instr(strTableName,"MEMBER",1) > 0 then
strSql = "UPDATE " & strMemberTablePrefix & strTableName & " SET"
else
strSql = "UPDATE " & strTablePrefix & strTableName & " SET"
end if
tmpArray = split(fieldArray(y),"#")
fName = tmpArray(0)
fValue = tmpArray(1)
fwhere = tmpArray(2)
strSql = strSql & " " & fName & " = " & fvalue & " WHERE " & fWhere
my_Conn.Execute strSql
next
There is a problem in that this function never checks to see if the fWhere (or Where clause) is an empty string or not. It will put "WHERE" in the sql string either way. When the Where caluse is then left blank, the database throws an error.
To solve it there should be an if structure to check the fWare variable for an empty string.
for y = 0 to numfields-1
if Instr(strTableName,"MEMBER",1) > 0 then
strSql = "UPDATE " & strMemberTablePrefix & strTableName & " SET"
else
strSql = "UPDATE " & strTablePrefix & strTableName & " SET"
end if
tmpArray = split(fieldArray(y),"#")
fName = tmpArray(0)
fValue = tmpArray(1)
fwhere = tmpArray(2)
strSql = strSql & " " & fName & " = " & fvalue
if trim(fWhere) <> "" then
strSql = strSql & " WHERE " & fWhere
end if
my_Conn.Execute strSql
next
Nathan Bales - Romans 15:13
----------------------------------
Snitz Exchange | Do's and Dont's