|
 |
access_asp thread: Syntax error
Message #1 by "Larry Rosenzweig" <rosenzl@o...> on Tue, 15 Jan 2002 19:23:57
|
|
Can somebody give me the syntax to add a 3rd field to the insert into
statement's values? Everything I tried failed. It works fine without the
CustomerID. The new field is a numeric intCustomerID and does exist in the
Access database as the last column. I need it following dDate.
Thanks for your help
Larry
If RS.BOF And RS.EOF Then
'Add a new One
SQL = "Insert into tblSchedule (" &_
"ResourceID, " &_
"ScheduleDate, " &_
"CustomerID) "
SQL = SQL & "VALUES ( " & intResourceID & ", #" & dDate & "#)"
End If
Conn.Execute(SQL)
Message #2 by lrosenzweig <rosenzl@o...> on Wed, 16 Jan 2002 07:06:07 -0500
|
|
This is my 2nd request. I would really appreciate it if someone can assist
me with the syntax needed for one additional field below.
-----Original Message-----
From: Larry Rosenzweig [mailto:rosenzl@o...]
Sent: Tuesday, January 15, 2002 2:24 PM
To: Access ASP
Subject: [access_asp] Syntax error
Can somebody give me the syntax to add a 3rd field to the insert into
statement's values? Everything I tried failed. It works fine without the
CustomerID. The new field is a numeric intCustomerID and does exist in the
Access database as the last column. I need it following dDate.
Thanks for your help
Larry
If RS.BOF And RS.EOF Then
'Add a new One
SQL = "Insert into tblSchedule (" &_
"ResourceID, " &_
"ScheduleDate, " &_
"CustomerID) "
SQL = SQL & "VALUES ( " & intResourceID & ", #" & dDate & "#)"
End If
Conn.Execute(SQL)
Message #3 by "sharon buggle" <s.buggle@w...> on Fri, 18 Jan 2002 17:10:14
|
|
> This is my 2nd request. I would really appreciate it if someone can
assist
> me with the syntax needed for one additional field below.
>
> -----Original Message-----
> From: Larry Rosenzweig [mailto:rosenzl@o...]
> Sent: Tuesday, January 15, 2002 2:24 PM
> To: Access ASP
> Subject: [access_asp] Syntax error
>
> Can somebody give me the syntax to add a 3rd field to the insert into
> statement's values? Everything I tried failed. It works fine without the
> CustomerID. The new field is a numeric intCustomerID and does exist in
the
> Access database as the last column. I need it following dDate.
>
> Thanks for your help
>
> Larry
>
> If RS.BOF And RS.EOF Then
> 'Add a new One
> SQL = "Insert into tblSchedule (" &_
> "ResourceID, " &_
> "ScheduleDate, " &_
> "CustomerID) "
> SQL = SQL & "VALUES ( " & intResourceID & ", #" & dDate & "#)"
> End If
> Conn.Execute(SQL)
>
>
If this is an Access table , i think you have to add the column either in
data sheet view or design view first.
SB
Message #4 by "Scott Reed" <scottr@m...> on Fri, 18 Jan 2002 12:54:31 -0600
|
|
Syntax
' Prepare the SQL insert command
cmdSQLinsert = "insert into Table (Field1, Field2, Field3, Field4, Field5)
values ('" & _
strValue1 & "', '" & strValue2 & "', '" & strValue3 & "', '"
& strValue4 & "', '" & strValue5 & "')"
' Execute the SQL insert command
objConn.Execute cmdSQLinsert
Scott
-----Original Message-----
From: sharon buggle [mailto:s.buggle@w...]
Sent: Friday, January 18, 2002 5:10 PM
To: Access ASP
Subject: [access_asp] RE: Syntax error
> This is my 2nd request. I would really appreciate it if someone can
assist
> me with the syntax needed for one additional field below.
>
> -----Original Message-----
> From: Larry Rosenzweig [mailto:rosenzl@o...]
> Sent: Tuesday, January 15, 2002 2:24 PM
> To: Access ASP
> Subject: [access_asp] Syntax error
>
> Can somebody give me the syntax to add a 3rd field to the insert into
> statement's values? Everything I tried failed. It works fine without the
> CustomerID. The new field is a numeric intCustomerID and does exist in
the
> Access database as the last column. I need it following dDate.
>
> Thanks for your help
>
> Larry
>
> If RS.BOF And RS.EOF Then
> 'Add a new One
> SQL = "Insert into tblSchedule (" &_
> "ResourceID, " &_
> "ScheduleDate, " &_
> "CustomerID) "
> SQL = SQL & "VALUES ( " & intResourceID & ", #" & dDate & "#)"
> End If
> Conn.Execute(SQL)
>
$subst('Email.Unsub').
>
If this is an Access table , i think you have to add the column either in
data sheet view or design view first.
SB
Message #5 by "Scott Reed" <scottr@m...> on Fri, 18 Jan 2002 13:13:25 -0600
|
|
Sorry, It looks like Outlook added a <br> or 2.....aaaanyway.....
' Prepare the SQL insert command. My example is all on 1 line!!!
cmdSQLinsert = "insert into tblSchedule(ResourseID, ScheduleDate,
CustomerID) values ('"intResourceID & "', '"dDate & "', '"intCustomerID &
"')"
' Execute the SQL insert command
objConn.Execute cmdSQLinsert
Make sure you are passing a variable that is actually holding a value for
customerID and that it is of the same Type.
Scott
-----Original Message-----
From: Scott Reed [mailto:scottr@m...]
Sent: Friday, January 18, 2002 12:55 PM
To: Access ASP
Subject: [access_asp] RE: Syntax error
Syntax
' Prepare the SQL insert command
cmdSQLinsert = "insert into Table (Field1, Field2, Field3, Field4, Field5)
values ('" & _
strValue1 & "', '" & strValue2 & "', '" & strValue3 & "', '"
& strValue4 & "', '" & strValue5 & "')"
' Execute the SQL insert command
objConn.Execute cmdSQLinsert
Scott
-----Original Message-----
From: sharon buggle [mailto:s.buggle@w...]
Sent: Friday, January 18, 2002 5:10 PM
To: Access ASP
Subject: [access_asp] RE: Syntax error
> This is my 2nd request. I would really appreciate it if someone can
assist
> me with the syntax needed for one additional field below.
>
> -----Original Message-----
> From: Larry Rosenzweig [mailto:rosenzl@o...]
> Sent: Tuesday, January 15, 2002 2:24 PM
> To: Access ASP
> Subject: [access_asp] Syntax error
>
> Can somebody give me the syntax to add a 3rd field to the insert into
> statement's values? Everything I tried failed. It works fine without the
> CustomerID. The new field is a numeric intCustomerID and does exist in
the
> Access database as the last column. I need it following dDate.
>
> Thanks for your help
>
> Larry
>
> If RS.BOF And RS.EOF Then
> 'Add a new One
> SQL = "Insert into tblSchedule (" &_
> "ResourceID, " &_
> "ScheduleDate, " &_
> "CustomerID) "
> SQL = SQL & "VALUES ( " & intResourceID & ", #" & dDate & "#)"
> End If
> Conn.Execute(SQL)
>
$subst('Email.Unsub').
>
If this is an Access table , i think you have to add the column either in
data sheet view or design view first.
SB
|
|
 |