You need to check for your description value and build you SQL string 
dynamically.  LIke this:
 
If Len(Trim(description)) = 0 then
   'No description.  Don't include it.
   SQL="INSERT INTO inventory (serialnumber,modelnumber) 
   values("& serialnumber & ", " & modelnumber & ")"
else
   'Description is present.  Include it.
   SQL="INSERT INTO inventory (serialnumber,modelnumber,description) 
   values("& serialnumber & ", " & modelnumber & ", '" & description & "')"
End If

Double check the syntax, as I typed it directly in this email.
 
Mark
 
kuku b <[EMAIL PROTECTED]> wrote:


i am getting too few parameters:expected 2 on line

SQL="INSERT INTO inventory (serialnumber,modelnumber,description) values("& 
serialnumber & ", " & modelnumber & ", '" & description & "')" 
conn.Execute SQL
which is becoz of the line above
i checked it with response.write so no value is going in description.

Mischa Kroon wrote:
close your recordset / connection then do that action :P



----- Original Message ----- 
From: "kuku b" 
To: 
Sent: Tuesday, November 16, 2004 4:38 PM
Subject: Re: [AspClassicAnyQuestionIsOk] problem linking



my code is now giving the error

ADODB.Connection (0x800A0E79)
Operation is not allowed when the object is open.
/inventory/inventory8.asp, line 64





---------------------------------
Do you Yahoo!?
The all-new My Yahoo! - Get yours free! 

[Non-text portions of this message have been removed]





Yahoo! Groups Links








Yahoo! Groups SponsorADVERTISEMENT


---------------------------------
Yahoo! Groups Links

To visit your group on the web, go to:
http://groups.yahoo.com/group/AspClassicAnyQuestionIsOk/

To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 



---------------------------------
Do you Yahoo!?
The all-new My Yahoo! � Get yours free! 

[Non-text portions of this message have been removed]





Yahoo! Groups Links











---------------------------------
Do you Yahoo!?
Discover all that�s new in My Yahoo!

[Non-text portions of this message have been removed]





Yahoo! Groups Links









[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspClassicAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to