Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: ASP Problem


Message #1 by Pouyan Paryas <pouyanparyas@y...> on Tue, 15 Oct 2002 02:26:28 -0700 (PDT)
PLEASE

HELP ME !!!!!!!!!!!!

 

Hello

I want to use addnew method for my asp page and i did exactly like MSDN help:

 

<%@ Language=VBScript %>

<html>

<head>

<meta name="GENERATOR" Content="Microsoft Visual Studio.NET 7.0">

</head>

<body>

 

<% f1= server.MapPath("db1.mdb") 'db1 is my data bank %>

 

            <% set db1 = Server.CreateObject("ADODB.connection")

                        db1.ConnectionString = "Driver={Microsoft Access Driver (*.mdb)};" &_

                        "DBQ=" & f1

                        

                        db1.Open

                        

            set rs = Server.CreateObject("ADODB.Recordset")

                        rs.Open "tbl1", db1, , adLockOptimistic, adCmdTable 'tbl1 is table

 

            

            rs.AddNew

            rs("f1") = "x1" 'f1, f2 and f3 is fields

            rs("f2") = "x2"

            rs("f3") = "x3"

            rs.Update

            rs.MoveFirst

 

            rs.Close

            set rs = nothing

            db1.Close

            set db1 = nothing          

            %>

 

 

 

</body>

</html>

 

But I received this error:

 

Error Type:

Microsoft VBScript runtime (0x800A0BB9)

Object required: ''

/test/Test-4.asp, line 18 

 

And I do not know why this error occurred? 

Please help me.

Thank for your kind in advanced.

Pouyan Paryas



---------------------------------
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos, & more
faith.yahoo.com
Message #2 by shawnc@u... on Wed, 16 Oct 2002 00:37:34
To use the ADO constants (adLockOptimistic,adCmdTable), you either need 
to define them, or include adovbs.inc in you document.  See 
http://www.adopenstatic.com/faq/800a0bb9step2.asp for more info.

Shawn

> 
PLEASE
HELP ME !!!!!!!!!!!!
 
Hello
I want to use addnew method for my asp page and i did exactly like MSDN 
help:

<%@ Language=VBScript %>
<html>
<head>
<meta name="GENERATOR" Content="Microsoft Visual Studio.NET 7.0">
</head>
<body>
 
<% f1= server.MapPath("db1.mdb") 'db1 is my data bank %>
 
            <% set db1 = Server.CreateObject("ADODB.connection")
                        db1.ConnectionString = "Driver={Microsoft Access 
Driver (*.mdb)};" &_
                        "DBQ=" & f1
                        
                        db1.Open
                        
            set rs = Server.CreateObject("ADODB.Recordset")
                        rs.Open "tbl1", db1, , adLockOptimistic, 
adCmdTable 'tbl1 is table
 
            rs.AddNew
            rs("f1") = "x1" 'f1, f2 and f3 is fields
            rs("f2") = "x2"
            rs("f3") = "x3"
            rs.Update
            rs.MoveFirst
 
            rs.Close
            set rs = nothing
            db1.Close
            set db1 = nothing          
            %>
</body>
</html>


But I received this error:

 

Error Type:
Microsoft VBScript runtime (0x800A0BB9)
Object required: ''
/test/Test-4.asp, line 18 
 
And I do not know why this error occurred? 
Please help me.
Thank for your kind in advanced.
Pouyan Paryas



  Return to Index