Ask a Question related to ASP Database, Design and Development.
-
Aaron Bertrand - MVP #1
Re: Connection and Recordset to SQL Server
Why are you grabbing the entire table in a SELECT statement, simply to add a
new row?
How about:
Set objConn1 = CreateObject("ADODB.Connection")
objConn1.Open "<connection string>"
objConn1.Execute "INSERT Customer(textColumn) VALUES('" & strText & "')"
--
Aaron Bertrand
SQL Server MVP
[url]http://www.aspfaq.com/[/url]
"Erik" <nospam@nospam.com> wrote in message
news:echQkpF4DHA.2332@TK2MSFTNGP10.phx.gbl...> I'm using ASP 3.0 and SQL Server 2000. I keep getting this error:
>
> a.. Error Type:
> ADODB.Recordset (0x800A0BB9)
> Arguments are of the wrong type, are out of acceptable range, or are in
> conflict with one another.
> /databaseconect.asp, line 22
>
> It seems to have to do with the lock or cursor type in SQL Server. Here is
> my code. Please help
>
> <%@ Language=VBScript %>
> <%
> strText = Request.Form("textfield")
> Dim objconn1 'Connection Object
> Dim strconn1
>
> Set objConn1 = Server.CreateObject("ADODB.Connection")
> strconn1 = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security
> Info=False;Initial Catalog=Northwind;Data Source=SERVER\SERVER"
> objconn1.Open strconn1
>
> ''Recordset Info
> Set rs1 = Server.CreateObject("ADODB.Recordset")
>
> rs1.Open "SELECT customername FROM Customer", objconn1, adOpenDynamic,
> adLockOptimistic, adCmdText
> rs1.AddNew
> rs1.Fields("textfield") = strText
> rs1.Update
> %>
>
>
>
>
>
Aaron Bertrand - MVP Guest
-
Error with local test server - cannot add recordset
:confused; Hi I am relatively new to this and learning via Dreamweaver's help but encountered problem. Running on Win2K and installed IIS... -
Problem with Recordset from SQL Server
I have just upsized an Access database to MS SQL and have begun converting and testing ASP pages created in Dreamweaver. After creating a Recordset... -
response.redirect and recordset/connection object?
I have the following code. Should I close and release the database objects before run response.redirect("some url")? or will the response.redirect... -
recordset not returning value from SQL server
HI There, I am having a little trouble displaying a recordset from SQL Server and I was wondering if someone could have a look at my code to see... -
Connection error: ADODB.Recordset (0x800A0E7D)
I have been copying and pasting code and this has been working, but now I get this error: Error Type: ADODB.Recordset (0x800A0E7D) Operation is... -
Erik #2
Connection and Recordset to SQL Server
I'm using ASP 3.0 and SQL Server 2000. I keep getting this error:
a.. Error Type:
ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in
conflict with one another.
/databaseconect.asp, line 22
It seems to have to do with the lock or cursor type in SQL Server. Here is
my code. Please help
<%@ Language=VBScript %>
<%
strText = Request.Form("textfield")
Dim objconn1 'Connection Object
Dim strconn1
Set objConn1 = Server.CreateObject("ADODB.Connection")
strconn1 = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security
Info=False;Initial Catalog=Northwind;Data Source=SERVER\SERVER"
objconn1.Open strconn1
''Recordset Info
Set rs1 = Server.CreateObject("ADODB.Recordset")
rs1.Open "SELECT customername FROM Customer", objconn1, adOpenDynamic,
adLockOptimistic, adCmdText
rs1.AddNew
rs1.Fields("textfield") = strText
rs1.Update
%>
Erik Guest
-
Biggie #3
Re: Connection and Recordset to SQL Server
Thanks. It worked. How do I account for the primary key field in SQL Server
2000. I get the error that the insert failed because the table has a primary
key that cannot be NULL.
Thanks.
"Aaron Bertrand - MVP" <aaron@TRASHaspfaq.com> wrote in message
news:OHeBurF4DHA.2404@TK2MSFTNGP10.phx.gbl...a> Why are you grabbing the entire table in a SELECT statement, simply to addis> new row?
>
> How about:
>
> Set objConn1 = CreateObject("ADODB.Connection")
> objConn1.Open "<connection string>"
> objConn1.Execute "INSERT Customer(textColumn) VALUES('" & strText & "')"
>
> --
> Aaron Bertrand
> SQL Server MVP
> [url]http://www.aspfaq.com/[/url]
>
>
>
>
> "Erik" <nospam@nospam.com> wrote in message
> news:echQkpF4DHA.2332@TK2MSFTNGP10.phx.gbl...> > I'm using ASP 3.0 and SQL Server 2000. I keep getting this error:
> >
> > a.. Error Type:
> > ADODB.Recordset (0x800A0BB9)
> > Arguments are of the wrong type, are out of acceptable range, or are in
> > conflict with one another.
> > /databaseconect.asp, line 22
> >
> > It seems to have to do with the lock or cursor type in SQL Server. HereSecurity> > my code. Please help
> >
> > <%@ Language=VBScript %>
> > <%
> > strText = Request.Form("textfield")
> > Dim objconn1 'Connection Object
> > Dim strconn1
> >
> > Set objConn1 = Server.CreateObject("ADODB.Connection")
> > strconn1 = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist>> > Info=False;Initial Catalog=Northwind;Data Source=SERVER\SERVER"
> > objconn1.Open strconn1
> >
> > ''Recordset Info
> > Set rs1 = Server.CreateObject("ADODB.Recordset")
> >
> > rs1.Open "SELECT customername FROM Customer", objconn1, adOpenDynamic,
> > adLockOptimistic, adCmdText
> > rs1.AddNew
> > rs1.Fields("textfield") = strText
> > rs1.Update
> > %>
> >
> >
> >
> >
> >
>
Biggie Guest
-
Mark Schupp #4
Re: Connection and Recordset to SQL Server
You will need to insert the primary key columns as well.
--
Mark Schupp
Head of Development
Integrity eLearning
[url]www.ielearning.com[/url]
"Biggie" <nospam@nospam.com> wrote in message
news:egaza3F4DHA.2080@TK2MSFTNGP11.phx.gbl...Server> Thanks. It worked. How do I account for the primary key field in SQLprimary> 2000. I get the error that the insert failed because the table has aadd> key that cannot be NULL.
>
> Thanks.
>
>
> "Aaron Bertrand - MVP" <aaron@TRASHaspfaq.com> wrote in message
> news:OHeBurF4DHA.2404@TK2MSFTNGP10.phx.gbl...> > Why are you grabbing the entire table in a SELECT statement, simply toin> a> > new row?
> >
> > How about:
> >
> > Set objConn1 = CreateObject("ADODB.Connection")
> > objConn1.Open "<connection string>"
> > objConn1.Execute "INSERT Customer(textColumn) VALUES('" & strText & "')"
> >
> > --
> > Aaron Bertrand
> > SQL Server MVP
> > [url]http://www.aspfaq.com/[/url]
> >
> >
> >
> >
> > "Erik" <nospam@nospam.com> wrote in message
> > news:echQkpF4DHA.2332@TK2MSFTNGP10.phx.gbl...> > > I'm using ASP 3.0 and SQL Server 2000. I keep getting this error:
> > >
> > > a.. Error Type:
> > > ADODB.Recordset (0x800A0BB9)
> > > Arguments are of the wrong type, are out of acceptable range, or areHere> > > conflict with one another.
> > > /databaseconect.asp, line 22
> > >
> > > It seems to have to do with the lock or cursor type in SQL Server.adOpenDynamic,> is> Security> > > my code. Please help
> > >
> > > <%@ Language=VBScript %>
> > > <%
> > > strText = Request.Form("textfield")
> > > Dim objconn1 'Connection Object
> > > Dim strconn1
> > >
> > > Set objConn1 = Server.CreateObject("ADODB.Connection")
> > > strconn1 = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist> > > Info=False;Initial Catalog=Northwind;Data Source=SERVER\SERVER"
> > > objconn1.Open strconn1
> > >
> > > ''Recordset Info
> > > Set rs1 = Server.CreateObject("ADODB.Recordset")
> > >
> > > rs1.Open "SELECT customername FROM Customer", objconn1,>> >> > > adLockOptimistic, adCmdText
> > > rs1.AddNew
> > > rs1.Fields("textfield") = strText
> > > rs1.Update
> > > %>
> > >
> > >
> > >
> > >
> > >
> >
>
Mark Schupp Guest



Reply With Quote

