Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: ASP code


Message #1 by "Frank Santos" <francisco_santos@3...> on Tue, 17 Sep 2002 16:47:03
Hi folks.

I'm trying to learn asp scripting. I've been refering to an article I 
found on the web. Based on some examples I've tried wring a simple script 
but it is not working. When the ASP file is called, after I enter data 
into an HTML form, I get the error message: 

Error Type:
ADODB.Command (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in 
conflict with one another.
/mydata/test.asp, line 7


The script I wrote is as follows:

<%                                                     
Set cnn = Server.CreateObject("ADODB.Connection")   
cnn.open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA 
SOURCE=C:\Inetpub\wwwroot\mydata\firewalls.mdb"  
Set cmn = Server.CreateObject("ADODB.Command")
Set cmn.ActiveConnection = cnn
cmn.CommandText = "INSERT INTO Firewall (Subject) VALUES (?)"    
cmn.Parameters.Append cmn.CreateParameter ("sub", adVarChar, 25)   
cmn("sub") = Request.Form("subject")
cmn.Execute ,,adCmdText + adExecuteNoRecords
%>


The HTML code is as follows:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
  <TITLE>test</TITLE>
</HEAD>

<BODY BGCOLOR="#FFFFFF">
<form method="get" action="test.asp">
<legend>Subject</legend>
<input type="text" name="subject" size="25">

<p>
<input type="submit" value="Enter"> <input type="reset" value="Clear">
</form>

</BODY>
</HTML>

Could you please show me what I'm doing wrong? Thanks very much.

Frank
Message #2 by Greg Griffiths <greg2@s...> on Tue, 17 Sep 2002 19:41:09 +0100
take a look at :

http://www.google.com/search?sourceid=navclient&q=0x800A0BB9

At 16:47 17/09/02 +0000, you wrote:
>0x800A0BB9



  Return to Index