Re: ASP ADO?
From: Agoston Bejo (gusz1_at_freemail.hu)
Date: 07/27/04
- Previous message: nsreddy001: "Re: Accessing WSH objects from within IE"
- In reply to: Sam: "ASP ADO?"
- Next in thread: Jim: "Re: ASP ADO?"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 27 Jul 2004 09:59:03 +0200
The correct format of the SQL INSERT statement is:
INSERT INTO table_name(field1, field2, ..., fieldn)
VALUES (value_1, value_2, ..., value_n);
I'm not sure you cannot insert a row without specifying all the columns, but
I guess you can't. But why don't put NULL values manually into the unused
columns?
INSERT INTO INSERT INTO F0911C (GLKCO, GLDCT, GLDOC, GLDGJ ) VALUES(0010',
NULL, NULL, NULL);
This always works (provided that NULL values are allowed in the last three
columns).
"Sam" <cybersam88@hotmail.com> wrote in message
news:%23Ikab54cEHA.3016@tk2msftngp13.phx.gbl...
> Complete Coding
> ------------------
> rsAdd = "INSERT INTO F0911C (GLKCO, GLDCT, GLDOC, GLDGJ ) VALUES"
> rsAdd = rsAdd & " ('0010'),"
> rsAdd = rsAdd & " ('1234'),"
> rsAdd = rsAdd & " (104001),"
> rsAdd = rsAdd & " (1),"
>
> Question?
> ----------
> Can I perform the following coding (just wanna insert few table column
> instead of full table columns)?
> rsAdd = "INSERT INTO F0911C (GLKCO ) VALUES"
> rsAdd = rsAdd & " ('0010'),"
>
> Error Message When Perform Single Table Column (SQL Insert
> -----------------------------------------------------------------
> Microsoft OLE DB Provider for SQL Server error '80040e14'
> There are more columns in the INSERT statement than values specified in
the
> VALUES clause. The number of values in the VALUES clause must match the
> number of columns specified in the INSERT statement.
> /jde/F0911C.asp, line 104
>
> Please advise.
>
> Thanks.
>
>
- Previous message: nsreddy001: "Re: Accessing WSH objects from within IE"
- In reply to: Sam: "ASP ADO?"
- Next in thread: Jim: "Re: ASP ADO?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|