I am updating fields in an Access Database, some of which may contain null values.
I get an error stating "COUNT field incorrect" on the following statement:
I have attempted to use
I have worked on a similar program before (in SQL Server) with some success. Note I have dates and URLs as data fields and believe I have the SQL Statement coding correct there.
The code is as follows:
I get an error stating "COUNT field incorrect" on the following statement:
Code:
oRS.Open strSQL, objConn
I have attempted to use
Code:
objConn Execute strSQL
I have worked on a similar program before (in SQL Server) with some success. Note I have dates and URLs as data fields and believe I have the SQL Statement coding correct there.
The code is as follows:
Code:
Dim strSQL, id, nofa, Summary, Deadline, URL1
id = Request("id")
nofa = Request("nofa")
etc.
Response.Write strSQL & "<P>"
Dim sqlCount
strSQL = "UPDATE tblNofas SET"
If nofa <> "" Then
strSQL = strSQL & " nofa = " & nofa
sqlCount = True
End if
If Summary <> "" Then
If sqlCount Then
strSQL = strSQL & ", Summary = " & Summary
Else
strSQL = strSQL & " Summary = " & Summary
End If
sqlCount= True
End If
If Deadline <> "" Then
If sqlCount Then
strSQL = strSQL & ", Deadline = #" & Deadline & "#"
Else
strSQL = strSQL & " Deadline = #" & Deadline & "#"
End If
sqlCount= True
End If
If URL1 <> "" Then
If sqlCount Then
strSQL = strSQL & ", (URL1 = " & URL1 & ")"
Else
strSQL = strSQL & " (URL1 = " & URL1 &")"
End If
sqlCount= True
End If
strSQL = strSQL & " WHERE id = '" & id & "';"
Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "NOFA9"
objConn.Open
Dim oRS
set oRS = Server.CreateObject ("ADODB.recordset")
oRS.Open strSQL, objConn
Response.Write "<H1>updated</H1>"
'For testing
Response.Write strSQL & "<P>"