asp_databases thread: INSERT Error 80040e14
Message #1 by mike@i... on Tue, 26 Dec 2000 23:50:36 -0500
|
|
Hello
Can somebody tell me what is going on here. I keep getting this error
message
Microsoft JET Database engine error '80040e14'
Syntax error in INSERT INTO statement.
/military/addusercmd.asp, line 40 (Marked below)
I have tested the database connection using a select command and it
connects just fine.
<%
'Declare variables needed
Dim objConn
Dim strSource
Dim adCmdText
Dim strSQL
Dim strLogin
'Set required variables
adCmdText = 1
strLogin = Now
strSQL = "INSERT into Person (UsrFirstName, UsrLastName, EmailAddress,
StreetAddress, " & _
"City, State, ZipCode, Country, Password, Hint, LastLogin)" & _
"VALUES ('firstname', 'lastname','email', 'address', 'city', 'state',
'zip', 'country', 'password', 'hint', strLogin)"
Set objConn=Server.CreateObject("ADODB.Connection")
strSource = "Provider=Microsoft.Jet.OLEDB.4.0;"
strSource = strSource & "; Data Source=C:\datastores\TopSecret.mdb"
objConn.ConnectionString = strSource
objConn.Open
Set objCmd = Server.CreateObject("ADODB.Command")
'Set the command object properties
Set objCmd.ActiveConnection = objConn
objCmd.CommandText = strSQL
objCmd.CommandType = adCmdText
'Execute
objCmd.Execute ' THIS IS MY LINE 40
'Clean Up
Set objCmd = Nothing
objConn.Close
Set objConn = Nothing
%>
Thanks In Advance For Any Help
Mike Moore
---
FREE WEB DEVELOPMENT CODE, CONTENT, AND INSIGHTS
IN YOUR INBOX!
Get the latest and best HTML, XML, and JavaScript tips, tools, and
developments from the experts. Sign up for one or more of EarthWeb's
FREE IT newsletters at http://www.earthweb.com today!
---
You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')
To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com
Message #2 by Imar Spaanjaars <Imar@S...> on Wed, 27 Dec 2000 12:02:35 +0100
|
|
I think you need a space between the closing ) and the word VALUES.
As always, do a Response.Write of your SQL statement, right before you
execute the statement, or open a recordset.
Usually, the complete statement will give you some clues on what is going on.
If not, paste it in the query designer or in the query analyzer to see if
it works manually.
If you still can't get it to work, post the result of the SQL statement to
this list.
HtH
Imar
At 11:50 PM 12/26/2000 -0500, you wrote:
>Hello
>Can somebody tell me what is going on here. I keep getting this error
>message
>
>Microsoft JET Database engine error '80040e14'
>Syntax error in INSERT INTO statement.
>/military/addusercmd.asp, line 40 (Marked below)
>
>I have tested the database connection using a select command and it
>connects just fine.
>
><%
>'Declare variables needed
>Dim objConn
>Dim strSource
>Dim adCmdText
>Dim strSQL
>Dim strLogin
>
>'Set required variables
>adCmdText = 1
>strLogin = Now
>
>strSQL = "INSERT into Person (UsrFirstName, UsrLastName, EmailAddress,
>StreetAddress, " & _
> "City, State, ZipCode, Country, Password, Hint, LastLogin)" & _
> "VALUES ('firstname', 'lastname','email', 'address', 'city', 'state',
>'zip', 'country', 'password', 'hint', strLogin)"
>
>
>Set objConn=Server.CreateObject("ADODB.Connection")
> strSource = "Provider=Microsoft.Jet.OLEDB.4.0;"
> strSource = strSource & "; Data Source=C:\datastores\TopSecret.mdb"
>objConn.ConnectionString = strSource
>objConn.Open
>
>Set objCmd = Server.CreateObject("ADODB.Command")
>
>'Set the command object properties
>Set objCmd.ActiveConnection = objConn
>objCmd.CommandText = strSQL
>objCmd.CommandType = adCmdText
>
>
>'Execute
>objCmd.Execute ' THIS IS MY LINE 40
>
>
>
>'Clean Up
>Set objCmd = Nothing
>objConn.Close
>Set objConn = Nothing
>
>
>%>
>
>Thanks In Advance For Any Help
>Mike Moore
>
>
---
NEED TECHNICAL TIPS, TOOLS, AND INSIGHTS? Is FREE okay?
Visit EarthWeb for the latest in IT Management, Software Development,
Web Development, Networking & Communications, and Hardware & Systems.
Click on http://www.earthweb.com for FREE articles, tutorials,
and discussions from the experts.
---
You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')
To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com
Message #3 by mike@i... on Wed, 27 Dec 2000 10:09:55 -0600
|
|
I pasted it into Access like you suggested and get a the message
Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE',
'SELECT', or 'UPDATE'
When I write the SQL statement out on the web I get the following
message
heres the stuff
INSERT into Person (UsrFirstName, UsrLastName, EmailAddress,
StreetAddress, City, State, ZipCode, Country, Password, Hint, LastLogin)
VALUES
('firstname', 'lastname','email', 'address', 'city', 'state', 'zip',
'country', 'password', 'hint', strLogin)
Microsoft JET Database Engine error '80040e14'
Syntax error in INSERT INTO statement.
/addusercmd.asp, line 44
--- Imar Spaanjaars <Imar@S...> wrote:
> I think you need a space between the closing ) and
> the word VALUES.
> As always, do a Response.Write of your SQL
> statement, right before you
> execute the statement, or open a recordset.
> Usually, the complete statement will give you some
> clues on what is going on.
> If not, paste it in the query designer or in the
> query analyzer to see if
> it works manually.
>
> If you still can't get it to work, post the result
> of the SQL statement to
> this list.
>
>
> HtH
>
> Imar
>
>
> At 11:50 PM 12/26/2000 -0500, you wrote:
> >Hello
> >Can somebody tell me what is going on here. I keep
> getting this error
> >message
> >
> >Microsoft JET Database engine error '80040e14'
> >Syntax error in INSERT INTO statement.
> >/military/addusercmd.asp, line 40 (Marked below)
> >
> >I have tested the database connection using a
> select command and it
> >connects just fine.
> >
> ><%
> >'Declare variables needed
> >Dim objConn
> >Dim strSource
> >Dim adCmdText
> >Dim strSQL
> >Dim strLogin
> >
> >'Set required variables
> >adCmdText = 1
> >strLogin = Now
> >
> >strSQL = "INSERT into Person (UsrFirstName,
> UsrLastName, EmailAddress,
> >StreetAddress, " & _
> > "City, State, ZipCode, Country, Password, Hint,
> LastLogin)" & _
> > "VALUES ('firstname', 'lastname','email',
> 'address', 'city', 'state',
> >'zip', 'country', 'password', 'hint', strLogin)"
> >
> >
> >Set objConn=Server.CreateObject("ADODB.Connection")
> > strSource = "Provider=Microsoft.Jet.OLEDB.4.0;"
> > strSource = strSource & "; Data
> Source=C:\datastores\TopSecret.mdb"
> >objConn.ConnectionString = strSource
> >objConn.Open
> >
> >Set objCmd = Server.CreateObject("ADODB.Command")
> >
> >'Set the command object properties
> >Set objCmd.ActiveConnection = objConn
> >objCmd.CommandText = strSQL
> >objCmd.CommandType = adCmdText
> >
> >
> >'Execute
> >objCmd.Execute ' THIS IS MY LINE 40
> >
> >
> >
> >'Clean Up
> >Set objCmd = Nothing
> >objConn.Close
> >Set objConn = Nothing
> >
> >
> >%>
> >
> >Thanks In Advance For Any Help
> >Mike Moore
> >
> >
>
---
NEED TECHNICAL TIPS, TOOLS, AND INSIGHTS? Is FREE okay?
Visit EarthWeb for the latest in IT Management, Software Development,
Web Development, Networking & Communications, and Hardware & Systems.
Click on http://www.earthweb.com for FREE articles, tutorials,
and discussions from the experts.
---
You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')
To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com
Message #4 by Gregory_Griffiths@c... on Wed, 27 Dec 2000 17:03:19 +0000
|
|
what does the strLogin contain ?
> -----Original Message-----
> From: mike@i... [mailto:mike@i...]
> Sent: 27 December 2000 16:10
> To: asp_databases@p...
> Cc: mike@i...
> Subject: [asp_databases] Re: INSERT Error 80040e14
>
>
> I pasted it into Access like you suggested and get a the message
> Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE',
> 'SELECT', or 'UPDATE'
>
> When I write the SQL statement out on the web I get the following
> message
> heres the stuff
>
> INSERT into Person (UsrFirstName, UsrLastName, EmailAddress,
> StreetAddress, City, State, ZipCode, Country, Password, Hint,
> LastLogin)
> VALUES
> ('firstname', 'lastname','email', 'address', 'city', 'state', 'zip',
> 'country', 'password', 'hint', strLogin)
>
> Microsoft JET Database Engine error '80040e14'
>
> Syntax error in INSERT INTO statement.
>
> /addusercmd.asp, line 44
>
>
>
>
> --- Imar Spaanjaars <Imar@S...> wrote:
> > I think you need a space between the closing ) and
> > the word VALUES.
> > As always, do a Response.Write of your SQL
> > statement, right before you
> > execute the statement, or open a recordset.
> > Usually, the complete statement will give you some
> > clues on what is going on.
> > If not, paste it in the query designer or in the
> > query analyzer to see if
> > it works manually.
> >
> > If you still can't get it to work, post the result
> > of the SQL statement to
> > this list.
> >
> >
> > HtH
> >
> > Imar
> >
> >
> > At 11:50 PM 12/26/2000 -0500, you wrote:
> > >Hello
> > >Can somebody tell me what is going on here. I keep
> > getting this error
> > >message
> > >
> > >Microsoft JET Database engine error '80040e14'
> > >Syntax error in INSERT INTO statement.
> > >/military/addusercmd.asp, line 40 (Marked below)
> > >
> > >I have tested the database connection using a
> > select command and it
> > >connects just fine.
> > >
> > ><%
> > >'Declare variables needed
> > >Dim objConn
> > >Dim strSource
> > >Dim adCmdText
> > >Dim strSQL
> > >Dim strLogin
> > >
> > >'Set required variables
> > >adCmdText = 1
> > >strLogin = Now
> > >
> > >strSQL = "INSERT into Person (UsrFirstName,
> > UsrLastName, EmailAddress,
> > >StreetAddress, " & _
> > > "City, State, ZipCode, Country, Password, Hint,
> > LastLogin)" & _
> > > "VALUES ('firstname', 'lastname','email',
> > 'address', 'city', 'state',
> > >'zip', 'country', 'password', 'hint', strLogin)"
> > >
> > >
> > >Set objConn=Server.CreateObject("ADODB.Connection")
> > > strSource = "Provider=Microsoft.Jet.OLEDB.4.0;"
> > > strSource = strSource & "; Data
> > Source=C:\datastores\TopSecret.mdb"
> > >objConn.ConnectionString = strSource
> > >objConn.Open
> > >
> > >Set objCmd = Server.CreateObject("ADODB.Command")
> > >
> > >'Set the command object properties
> > >Set objCmd.ActiveConnection = objConn
> > >objCmd.CommandText = strSQL
> > >objCmd.CommandType = adCmdText
> > >
> > >
> > >'Execute
> > >objCmd.Execute ' THIS IS MY LINE 40
> > >
> > >
> > >
> > >'Clean Up
> > >Set objCmd = Nothing
> > >objConn.Close
> > >Set objConn = Nothing
> > >
> > >
> > >%>
> > >
> > >Thanks In Advance For Any Help
> > >Mike Moore
> > >
> > >
> >
>
---
NEED TECHNICAL TIPS, TOOLS, AND INSIGHTS? Is FREE okay?
Visit EarthWeb for the latest in IT Management, Software Development,
Web Development, Networking & Communications, and Hardware & Systems.
Click on http://www.earthweb.com for FREE articles, tutorials,
and discussions from the experts.
---
You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')
To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com
Message #5 by Imar Spaanjaars <Imar@S...> on Wed, 27 Dec 2000 18:32:17 +0100
|
|
Hi there,
OK, I still think you need a space before the values. But, you also need to
enclose the value of strLogin in apostrophes:
sSQL = INSERT into Person (UsrFirstName, UsrLastName, EmailAddress,
StreetAddress, City, State, ZipCode, Country, Password, Hint, LastLogin)
VALUES ('firstname', 'lastname','email', 'address', 'city', 'state', 'zip',
'country', 'password', 'hint', '" & strLogin & "'")
This all should be on one line (I wrapped for clarity) or use the _ to
continue on the next line, like you did in the previous code.
HtH
Imar
At 10:09 AM 12/27/2000 -0600, you wrote:
>I pasted it into Access like you suggested and get a the message
>Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE',
>'SELECT', or 'UPDATE'
>
>When I write the SQL statement out on the web I get the following
>message
>heres the stuff
>
>INSERT into Person (UsrFirstName, UsrLastName, EmailAddress,
>StreetAddress, City, State, ZipCode, Country, Password, Hint, LastLogin)
>VALUES
>('firstname', 'lastname','email', 'address', 'city', 'state', 'zip',
>'country', 'password', 'hint', strLogin)
>
>Microsoft JET Database Engine error '80040e14'
>
>Syntax error in INSERT INTO statement.
>
>/addusercmd.asp, line 44
---
FREE SOFTWARE DEVELOPMENT CODE, CONTENT, AND
INSIGHTS IN YOUR INBOX!
Get the latest and best C++, Visual C++, Java, Visual Basic, and XML tips, tools, and
developments from the experts. Sign up for one or more of EarthWeb?s
FREE IT newsletters at http://www.earthweb.com today!
---
You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')
To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com
Message #6 by mike@i... on Wed, 27 Dec 2000 12:52:56 -0500
|
|
Date and time. I've taken that out and tried it, but still get the same results
Gregory_Griffiths@c... wrote:
> what does the strLogin contain ?
>
> > -----Original Message-----
> > From: mike@i... [mailto:mike@i...]
> > Sent: 27 December 2000 16:10
> > To: asp_databases@p...
> > Cc: mike@i...
> > Subject: [asp_databases] Re: INSERT Error 80040e14
> >
> >
> > I pasted it into Access like you suggested and get a the message
> > Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE',
> > 'SELECT', or 'UPDATE'
> >
> > When I write the SQL statement out on the web I get the following
> > message
> > heres the stuff
> >
> > INSERT into Person (UsrFirstName, UsrLastName, EmailAddress,
> > StreetAddress, City, State, ZipCode, Country, Password, Hint,
> > LastLogin)
> > VALUES
> > ('firstname', 'lastname','email', 'address', 'city', 'state', 'zip',
> > 'country', 'password', 'hint', strLogin)
> >
> > Microsoft JET Database Engine error '80040e14'
> >
> > Syntax error in INSERT INTO statement.
> >
> > /addusercmd.asp, line 44
> >
> >
> >
> >
> > --- Imar Spaanjaars <Imar@S...> wrote:
> > > I think you need a space between the closing ) and
> > > the word VALUES.
> > > As always, do a Response.Write of your SQL
> > > statement, right before you
> > > execute the statement, or open a recordset.
> > > Usually, the complete statement will give you some
> > > clues on what is going on.
> > > If not, paste it in the query designer or in the
> > > query analyzer to see if
> > > it works manually.
> > >
> > > If you still can't get it to work, post the result
> > > of the SQL statement to
> > > this list.
> > >
> > >
> > > HtH
> > >
> > > Imar
> > >
> > >
> > > At 11:50 PM 12/26/2000 -0500, you wrote:
> > > >Hello
> > > >Can somebody tell me what is going on here. I keep
> > > getting this error
> > > >message
> > > >
> > > >Microsoft JET Database engine error '80040e14'
> > > >Syntax error in INSERT INTO statement.
> > > >/military/addusercmd.asp, line 40 (Marked below)
> > > >
> > > >I have tested the database connection using a
> > > select command and it
> > > >connects just fine.
> > > >
> > > ><%
> > > >'Declare variables needed
> > > >Dim objConn
> > > >Dim strSource
> > > >Dim adCmdText
> > > >Dim strSQL
> > > >Dim strLogin
> > > >
> > > >'Set required variables
> > > >adCmdText = 1
> > > >strLogin = Now
> > > >
> > > >strSQL = "INSERT into Person (UsrFirstName,
> > > UsrLastName, EmailAddress,
> > > >StreetAddress, " & _
> > > > "City, State, ZipCode, Country, Password, Hint,
> > > LastLogin)" & _
> > > > "VALUES ('firstname', 'lastname','email',
> > > 'address', 'city', 'state',
> > > >'zip', 'country', 'password', 'hint', strLogin)"
> > > >
> > > >
> > > >Set objConn=Server.CreateObject("ADODB.Connection")
> > > > strSource = "Provider=Microsoft.Jet.OLEDB.4.0;"
> > > > strSource = strSource & "; Data
> > > Source=C:\datastores\TopSecret.mdb"
> > > >objConn.ConnectionString = strSource
> > > >objConn.Open
> > > >
> > > >Set objCmd = Server.CreateObject("ADODB.Command")
> > > >
> > > >'Set the command object properties
> > > >Set objCmd.ActiveConnection = objConn
> > > >objCmd.CommandText = strSQL
> > > >objCmd.CommandType = adCmdText
> > > >
> > > >
> > > >'Execute
> > > >objCmd.Execute ' THIS IS MY LINE 40
> > > >
> > > >
> > > >
> > > >'Clean Up
> > > >Set objCmd = Nothing
> > > >objConn.Close
> > > >Set objConn = Nothing
> > > >
> > > >
> > > >%>
> > > >
> > > >Thanks In Advance For Any Help
> > > >Mike Moore
> > > >
> > > >
> > >
> >
---
NEED TECHNICAL TIPS, TOOLS, AND INSIGHTS? Is FREE okay?
Visit EarthWeb for the latest in IT Management, Software Development,
Web Development, Networking & Communications, and Hardware & Systems.
Click on http://www.earthweb.com for FREE articles, tutorials,
and discussions from the experts.
---
You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')
To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com
Message #7 by "Wally Burfine" <oopconsultant@h...> on Wed, 27 Dec 2000 21:16:52 -0000
|
|
Hi, Mike,
First off is the field "Zip" a number field or a character field? If it's a
number field then it shouldn't be in quotes. Second, it's a little unclear
to me exactly what you are doing, but, if you are setting the values into
the sql string from variables you would use
values ('" & variable & "', '" ... etc
I always just use the connection objcet to do the action queries:
conn.Execute sql,, 1
Good luck
Wally Burfine
>From: mike@i... (INEX- Mike Moore)
>Reply-To: "ASP Databases" <asp_databases@p...>
>To: "ASP Databases" <asp_databases@p...>
>Subject: [asp_databases] INSERT Error 80040e14
>Date: Tue, 26 Dec 2000 23:50:36 -0500
>
>Hello
>Can somebody tell me what is going on here. I keep getting this error
>message
>
>Microsoft JET Database engine error '80040e14'
>Syntax error in INSERT INTO statement.
>/military/addusercmd.asp, line 40 (Marked below)
>
>I have tested the database connection using a select command and it
>connects just fine.
>
><%
>'Declare variables needed
>Dim objConn
>Dim strSource
>Dim adCmdText
>Dim strSQL
>Dim strLogin
>
>'Set required variables
>adCmdText = 1
>strLogin = Now
>
>strSQL = "INSERT into Person (UsrFirstName, UsrLastName, EmailAddress,
>StreetAddress, " & _
> "City, State, ZipCode, Country, Password, Hint, LastLogin)" & _
> "VALUES ('firstname', 'lastname','email', 'address', 'city', 'state',
>'zip', 'country', 'password', 'hint', strLogin)"
>
>
>Set objConn=Server.CreateObject("ADODB.Connection")
> strSource = "Provider=Microsoft.Jet.OLEDB.4.0;"
> strSource = strSource & "; Data Source=C:\datastores\TopSecret.mdb"
>objConn.ConnectionString = strSource
>objConn.Open
>
>Set objCmd = Server.CreateObject("ADODB.Command")
>
>'Set the command object properties
>Set objCmd.ActiveConnection = objConn
>objCmd.CommandText = strSQL
>objCmd.CommandType = adCmdText
>
>
>'Execute
>objCmd.Execute ' THIS IS MY LINE 40
>
>
>
>'Clean Up
>Set objCmd = Nothing
>objConn.Close
>Set objConn = Nothing
>
>
>%>
>
>Thanks In Advance For Any Help
>Mike Moore
>
>
---
NEED TECHNICAL TIPS, TOOLS, AND INSIGHTS? Is FREE okay?
Visit EarthWeb for the latest in IT Management, Software Development,
Web Development, Networking & Communications, and Hardware & Systems.
Click on http://www.earthweb.com for FREE articles, tutorials,
and discussions from the experts.
---
You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')
To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com
Message #8 by mike@i... on Wed, 27 Dec 2000 15:52:01 -0500
|
|
Thanks for you help,
I have put everything on one line and still get the same message, the LastLogin is
working correctly, though.
write out srtSQL
INSERT into Person(UsrFirstName, UsrLastName, EmailAddress, StreetAddress, City, State,
ZipCode, Country, Password, Hint, LastLogin) VALUES
('firstname', 'lastname','email', 'address', 'city', 'state', 'zip', 'country',
'password', 'hint', '12/27/00 3:53:56 PM')
Microsoft JET Database Engine error '80040e14'
Syntax error in INSERT INTO statement.
/addusercmd.asp, line 56
Imar Spaanjaars wrote:
> Hi there,
>
> OK, I still think you need a space before the values. But, you also need to
> enclose the value of strLogin in apostrophes:
>
> sSQL = INSERT into Person (UsrFirstName, UsrLastName, EmailAddress,
> StreetAddress, City, State, ZipCode, Country, Password, Hint, LastLogin)
> VALUES ('firstname', 'lastname','email', 'address', 'city', 'state', 'zip',
> 'country', 'password', 'hint', '" & strLogin & "'")
>
> This all should be on one line (I wrapped for clarity) or use the _ to
> continue on the next line, like you did in the previous code.
>
> HtH
>
> Imar
>
> At 10:09 AM 12/27/2000 -0600, you wrote:
> >I pasted it into Access like you suggested and get a the message
> >Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE',
> >'SELECT', or 'UPDATE'
> >
> >When I write the SQL statement out on the web I get the following
> >message
> >heres the stuff
> >
> >INSERT into Person (UsrFirstName, UsrLastName, EmailAddress,
> >StreetAddress, City, State, ZipCode, Country, Password, Hint, LastLogin)
> >VALUES
> >('firstname', 'lastname','email', 'address', 'city', 'state', 'zip',
> >'country', 'password', 'hint', strLogin)
> >
> >Microsoft JET Database Engine error '80040e14'
> >
> >Syntax error in INSERT INTO statement.
> >
> >/addusercmd.asp, line 44
>
---
FREE SOFTWARE DEVELOPMENT CODE, CONTENT, AND
INSIGHTS IN YOUR INBOX!
Get the latest and best C++, Visual C++, Java, Visual Basic, and XML tips, tools, and
developments from the experts. Sign up for one or more of EarthWeb?s
FREE IT newsletters at http://www.earthweb.com today!
---
You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')
To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com
Message #9 by Imar Spaanjaars <Imar@S...> on Thu, 28 Dec 2000 00:08:47 +0100
|
|
You are using Access, right?? My fault: you need to delimit dates in Access
with a # sign, instead of an apostrophe.
sSQL = INSERT into Person (UsrFirstName, UsrLastName, EmailAddress,
StreetAddress, City, State, ZipCode, Country, Password, Hint, LastLogin)
VALUES ('firstname', 'lastname','email', 'address', 'city', 'state', 'zip',
'country', 'password', 'hint', #" & strLogin & "#")
Also, check the date-type of your date. Does Access allow the time as
well?? I guess it does, but if it doesn't, cut it of your strLogin string.
One more hint: define a string called dateDelim for example.
Assign the # to it when working with Access databases. Should you ever
upgrade to SQL server, all you need to do is change this string to a ' and
all your code will work with SQL without any re-writing of code. It thus
enables you to switch between the two systems easily.
HtH
Imar
At 03:52 PM 12/27/2000 -0500, you wrote:
>Thanks for you help,
>I have put everything on one line and still get the same message, the
>LastLogin is
>working correctly, though.
>
>write out srtSQL
>
>INSERT into Person(UsrFirstName, UsrLastName, EmailAddress, StreetAddress,
>City, State,
>ZipCode, Country, Password, Hint, LastLogin) VALUES
>('firstname', 'lastname','email', 'address', 'city', 'state', 'zip',
>'country',
>'password', 'hint', '12/27/00 3:53:56 PM')
>
>Microsoft JET Database Engine error '80040e14'
>
>Syntax error in INSERT INTO statement.
>
>/addusercmd.asp, line 56
>
>
>
>
>Imar Spaanjaars wrote:
>
> > Hi there,
> >
> > OK, I still think you need a space before the values. But, you also need to
> > enclose the value of strLogin in apostrophes:
> >
> > sSQL = INSERT into Person (UsrFirstName, UsrLastName, EmailAddress,
> > StreetAddress, City, State, ZipCode, Country, Password, Hint, LastLogin)
> > VALUES ('firstname', 'lastname','email', 'address', 'city', 'state', 'zip',
> > 'country', 'password', 'hint', '" & strLogin & "'")
> >
> > This all should be on one line (I wrapped for clarity) or use the _ to
> > continue on the next line, like you did in the previous code.
> >
> > HtH
> >
> > Imar
> >
> > At 10:09 AM 12/27/2000 -0600, you wrote:
> > >I pasted it into Access like you suggested and get a the message
> > >Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE',
> > >'SELECT', or 'UPDATE'
> > >
> > >When I write the SQL statement out on the web I get the following
> > >message
> > >heres the stuff
> > >
> > >INSERT into Person (UsrFirstName, UsrLastName, EmailAddress,
> > >StreetAddress, City, State, ZipCode, Country, Password, Hint, LastLogin)
> > >VALUES
> > >('firstname', 'lastname','email', 'address', 'city', 'state', 'zip',
> > >'country', 'password', 'hint', strLogin)
> > >
> > >Microsoft JET Database Engine error '80040e14'
> > >
> > >Syntax error in INSERT INTO statement.
> > >
> > >/addusercmd.asp, line 44
> >
---
FREE SOFTWARE DEVELOPMENT CODE, CONTENT, AND
INSIGHTS IN YOUR INBOX!
Get the latest and best C++, Visual C++, Java, Visual Basic, and XML tips, tools, and
developments from the experts. Sign up for one or more of EarthWeb?s
FREE IT newsletters at http://www.earthweb.com today!
---
You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')
To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com
Message #10 by mike@i... on Wed, 27 Dec 2000 18:05:18 -0500
|
|
yohoo!
i got it to work, i was thinking maybe something was corrupt I switch between a mac and
pc, so i rewrote the page on pc and got the same error message. I started inserting one
thing at a time til it got to Password, then it got ugly . Is Password a reserved word?
I changed it and everything else worked great, even using the '" & strLogin & "' (in
Access), I will make the changes everybody suggested . Any clues as to why this would
happen?
I appreciate all the help, I even learned some new tricks!
Thanks
Mike Moore
Imar Spaanjaars wrote:
> You are using Access, right?? My fault: you need to delimit dates in Access
> with a # sign, instead of an apostrophe.
>
> sSQL = INSERT into Person (UsrFirstName, UsrLastName, EmailAddress,
> StreetAddress, City, State, ZipCode, Country, Password, Hint, LastLogin)
> VALUES ('firstname', 'lastname','email', 'address', 'city', 'state', 'zip',
> 'country', 'password', 'hint', #" & strLogin & "#")
>
> Also, check the date-type of your date. Does Access allow the time as
> well?? I guess it does, but if it doesn't, cut it of your strLogin string.
>
> One more hint: define a string called dateDelim for example.
> Assign the # to it when working with Access databases. Should you ever
> upgrade to SQL server, all you need to do is change this string to a ' and
> all your code will work with SQL without any re-writing of code. It thus
> enables you to switch between the two systems easily.
>
> HtH
>
> Imar
>
> At 03:52 PM 12/27/2000 -0500, you wrote:
> >Thanks for you help,
> >I have put everything on one line and still get the same message, the
> >LastLogin is
> >working correctly, though.
> >
> >write out srtSQL
> >
> >INSERT into Person(UsrFirstName, UsrLastName, EmailAddress, StreetAddress,
> >City, State,
> >ZipCode, Country, Password, Hint, LastLogin) VALUES
> >('firstname', 'lastname','email', 'address', 'city', 'state', 'zip',
> >'country',
> >'password', 'hint', '12/27/00 3:53:56 PM')
> >
> >Microsoft JET Database Engine error '80040e14'
> >
> >Syntax error in INSERT INTO statement.
> >
> >/addusercmd.asp, line 56
> >
> >
> >
> >
> >Imar Spaanjaars wrote:
> >
> > > Hi there,
> > >
> > > OK, I still think you need a space before the values. But, you also need to
> > > enclose the value of strLogin in apostrophes:
> > >
> > > sSQL = INSERT into Person (UsrFirstName, UsrLastName, EmailAddress,
> > > StreetAddress, City, State, ZipCode, Country, Password, Hint, LastLogin)
> > > VALUES ('firstname', 'lastname','email', 'address', 'city', 'state', 'zip',
> > > 'country', 'password', 'hint', '" & strLogin & "'")
> > >
> > > This all should be on one line (I wrapped for clarity) or use the _ to
> > > continue on the next line, like you did in the previous code.
> > >
> > > HtH
> > >
> > > Imar
> > >
> > > At 10:09 AM 12/27/2000 -0600, you wrote:
> > > >I pasted it into Access like you suggested and get a the message
> > > >Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE',
> > > >'SELECT', or 'UPDATE'
> > > >
> > > >When I write the SQL statement out on the web I get the following
> > > >message
> > > >heres the stuff
> > > >
> > > >INSERT into Person (UsrFirstName, UsrLastName, EmailAddress,
> > > >StreetAddress, City, State, ZipCode, Country, Password, Hint, LastLogin)
> > > >VALUES
> > > >('firstname', 'lastname','email', 'address', 'city', 'state', 'zip',
> > > >'country', 'password', 'hint', strLogin)
> > > >
> > > >Microsoft JET Database Engine error '80040e14'
> > > >
> > > >Syntax error in INSERT INTO statement.
> > > >
> > > >/addusercmd.asp, line 44
> > >
>
---
FREE SOFTWARE DEVELOPMENT CODE, CONTENT, AND
INSIGHTS IN YOUR INBOX!
Get the latest and best C++, Visual C++, Java, Visual Basic, and XML tips, tools, and
developments from the experts. Sign up for one or more of EarthWeb?s
FREE IT newsletters at http://www.earthweb.com today!
---
You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')
To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com
Message #11 by "Wally Burfine" <oopconsultant@h...> on Thu, 28 Dec 2000 02:27:56 -0000
|
|
If LastLogin is a time/date field, you should delimit it with # rather than
' which is for strings.
Wally Burfine
>From: mike@i... (INEX- Mike Moore)
>Reply-To: "ASP Databases" <asp_databases@p...>
>To: "ASP Databases" <asp_databases@p...>
>Subject: [asp_databases] Re: INSERT Error 80040e14
>Date: Wed, 27 Dec 2000 15:52:01 -0500
>
>Thanks for you help,
>I have put everything on one line and still get the same message, the
>LastLogin is
>working correctly, though.
>
>write out srtSQL
>
>INSERT into Person(UsrFirstName, UsrLastName, EmailAddress, StreetAddress,
>City, State,
>ZipCode, Country, Password, Hint, LastLogin) VALUES
>('firstname', 'lastname','email', 'address', 'city', 'state', 'zip',
>'country',
>'password', 'hint', '12/27/00 3:53:56 PM')
>
>Microsoft JET Database Engine error '80040e14'
>
>Syntax error in INSERT INTO statement.
>
>/addusercmd.asp, line 56
>
>
>
>
>Imar Spaanjaars wrote:
>
> > Hi there,
> >
> > OK, I still think you need a space before the values. But, you also need
>to
> > enclose the value of strLogin in apostrophes:
> >
> > sSQL = INSERT into Person (UsrFirstName, UsrLastName, EmailAddress,
> > StreetAddress, City, State, ZipCode, Country, Password, Hint, LastLogin)
> > VALUES ('firstname', 'lastname','email', 'address', 'city', 'state',
>'zip',
> > 'country', 'password', 'hint', '" & strLogin & "'")
> >
> > This all should be on one line (I wrapped for clarity) or use the _ to
> > continue on the next line, like you did in the previous code.
> >
> > HtH
> >
> > Imar
> >
> > At 10:09 AM 12/27/2000 -0600, you wrote:
> > >I pasted it into Access like you suggested and get a the message
> > >Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE',
> > >'SELECT', or 'UPDATE'
> > >
> > >When I write the SQL statement out on the web I get the following
> > >message
> > >heres the stuff
> > >
> > >INSERT into Person (UsrFirstName, UsrLastName, EmailAddress,
> > >StreetAddress, City, State, ZipCode, Country, Password, Hint,
>LastLogin)
> > >VALUES
> > >('firstname', 'lastname','email', 'address', 'city', 'state', 'zip',
> > >'country', 'password', 'hint', strLogin)
> > >
> > >Microsoft JET Database Engine error '80040e14'
> > >
> > >Syntax error in INSERT INTO statement.
> > >
> > >/addusercmd.asp, line 44
> >
>
---
NEED TECHNICAL TIPS, TOOLS, AND INSIGHTS? Is FREE okay?
Visit EarthWeb for the latest in IT Management, Software Development,
Web Development, Networking & Communications, and Hardware & Systems.
Click on http://www.earthweb.com for FREE articles, tutorials,
and discussions from the experts.
---
You are currently subscribed to asp_databases as: $subst('Recip.EmailAddr')
To unsubscribe send a blank email to leave-asp_databases-$subst('Recip.MemberIDChar')@p2p.wrox.com
|