|
 |
asp_databases thread: The Database Problem
Message #1 by "Zeeshan Hayat" <zeeshanhayat@y...> on Tue, 26 Jun 2001 18:16:38
|
|
> set recordset=objcommand.Execute
> set objcommand=nothing
> recordset.Close
> set recordset=nothing
>
>
> this piece of code works fine for entering two values in a table but
when
> i try to insert more then two records it doesnot work and it generates
an
> error. will any one help me with that
> i am using access database
>
>
> the error it gives is syntax error in INTO clause
>
> I have checked the syntax again and again and it still doesn't work for
> inserting more than two enteries
> also all the fields in the database are valid enteries that is all are
memo
can any one help me with that
Message #2 by Gee Vee <happygv@y...> on Tue, 26 Jun 2001 22:19:16 -0700 (PDT)
|
|
Hi,
Send us the SQL statement that you use for inserting
values, So that we will have a look at it and find out
the problem.
Regards
Vijay.G
--- Zeeshan Hayat <zeeshanhayat@y...> wrote:
> > set recordset=objcommand.Execute
> > set objcommand=nothing
> > recordset.Close
> > set recordset=nothing
> >
> >
> > this piece of code works fine for entering two
> values in a table but
> when
> > i try to insert more then two records it doesnot
> work and it generates
> an
> > error. will any one help me with that
> > i am using access database
> >
> >
> > the error it gives is syntax error in INTO clause
> >
> > I have checked the syntax again and again and it
> still doesn't work for
> > inserting more than two enteries
> > also all the fields in the database are valid
> enteries that is all are
> memo
> can any one help me with that
Message #3 by "Zeeshan Hayat" <zeeshanhayat@y...> on Thu, 28 Jun 2001 19:03:45
|
|
dim objcommand, recordset
set objcommand=server.CreateObject ("adodb.command")
objcommand.ActiveConnection =strconnect
objcommand.CommandText ="insert into tablename"&_
(firstname, secondname,
email, country )"&_
"values ('value1', 'value2', 'value3', 'value4') "
objcommand.CommandType =adCmdText
set recordset=objcommand.Execute
set objcommand=nothing
recordset.Close
set recordset=nothing
this piece of code works fine for entering two values in a
table but when
i try to insert more then two records it doesnot work and
it generates an
error. will any one help me with that
i am using access database
the error it gives is syntax error in INTO clause
I have checked the syntax again and again and it still
doesn't work for
inserting more than two enteries
also all the fields in the database are valid enteries
that is all are memo
Message #4 by "Tomm Matthis" <matthis@b...> on Thu, 28 Jun 2001 15:08:25 -0400
|
|
Why are you SET-ting a recordset? Insert doesn't return anything.
-- Tomm
> -----Original Message-----
> From: Zeeshan Hayat [mailto:zeeshanhayat@y...]
> Sent: Thursday, June 28, 2001 7:04 PM
> To: ASP Databases
> Subject: [asp_databases] The Database Problem
>
>
> dim objcommand, recordset
> set objcommand=3Dserver.CreateObject
("adodb.command")
> objcommand.ActiveConnection =3Dstrconnect
> objcommand.CommandText =3D"insert into tablename"&_
> (firstname, secondname,
> email, country )"&_
> "values ('value1', 'value2', 'value3', 'value4') "
>
> objcommand.CommandType =3DadCmdText
>
> set recordset=3Dobjcommand.Execute
> set objcommand=3Dnothing
> recordset.Close
> set recordset=3Dnothing
>
>
> this piece of code works fine for entering two
> values in a
> table but when
> i try to insert more then two records it doesnot
> work and
> it generates an
> error. will any one help me with that
> i am using access database
>
>
> the error it gives is syntax error in INTO clause
>
> I have checked the syntax again and again and it
still
> doesn't work for
> inserting more than two enteries
> also all the fields in the database are valid
enteries
> that is all are memo
|
|
 |