When I try and save out a recordset from an ASP page as XML I get the
following error (the code is below) - I have ADO 2.8 installed and this
is running on win XP sp2 :
----------------------------------------------------------
ADODB.Recordset error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in
conflict with one another.
----------------------------------------------------------
Const adOpenStatic = 3
Const adLockReadOnly = 1
Const adCmdText = 1
Const adPersistXML = 1
Dim rS
Dim conn
Dim sql
Dim xmlDoc
Set rS = Server.CreateObject ("ADODB.Recordset")
Response.ContentType = "text/xml"
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "DSN=Test;UID=sa;PWD="
set xmlDoc=Server.CreateObject("Microsoft.XmlDom")
xmlDoc.async = false
xmlDoc.preservewhitespace = false
sql = "SELECT * FROM test"
rS.open sql, conn, adOpenStatic, adLockReadOnly, adCmdText
rS.save xmlDoc, adPersistXML
rS.close
Set conn = nothing
Set rs = Nothing
-----------------------------------------------------------
Any ideas? Thanks.
Pierre 10 4085
Kasp wrote: When I try and save out a recordset from an ASP page as XML I get the following error (the code is below) - I have ADO 2.8 installed and this is running on win XP sp2 :
----------------------------------------------------------
ADODB.Recordset error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
----------------------------------------------------------
Which line of code causes this error?
Const adOpenStatic = 3 Const adLockReadOnly = 1 Const adCmdText = 1 Const adPersistXML = 1
Dim rS Dim conn Dim sql Dim xmlDoc
Set rS = Server.CreateObject ("ADODB.Recordset") Response.ContentType = "text/xml"
Set conn = Server.CreateObject("ADODB.Connection") conn.Open "DSN=Test;UID=sa;PWD="
You're using sa for an application??? bad idea. set xmlDoc=Server.CreateObject("Microsoft.XmlDom")
Try:
set xmlDoc=Server.CreateObject("msxml2.DomDocument")
xmlDoc.async = false xmlDoc.preservewhitespace = false
sql = "SELECT * FROM test" rS.open sql, conn, adOpenStatic, adLockReadOnly, adCmdText
Nothing to do with your problem, but why use a static cursor? A forwardonly
cursor is all you need:
set rs = conn.execute(sql,,adCmdText)
I would test rs for EOF before doing anything with it ...
rS.save xmlDoc, adPersistXML rS.close
Set conn = nothing Set rs = Nothing
----------------------------------------------------------- Any ideas? Thanks.
Pierre
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
> Kasp wrote: When I try and save out a recordset from an ASP page as XML I get the following error (the code is below) - I have ADO 2.8 installed and this is running on win XP sp2 :
----------------------------------------------------------
ADODB.Recordset error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
----------------------------------------------------------
Which line of code causes this error?
rS.save xmlDoc, adPersistXML Const adOpenStatic = 3 Const adLockReadOnly = 1 Const adCmdText = 1 Const adPersistXML = 1
Dim rS Dim conn Dim sql Dim xmlDoc
Set rS = Server.CreateObject ("ADODB.Recordset") Response.ContentType = "text/xml"
Set conn = Server.CreateObject("ADODB.Connection") conn.Open "DSN=Test;UID=sa;PWD="
You're using sa for an application??? bad idea.
It is only for testing set xmlDoc=Server.CreateObject("Microsoft.XmlDom")
Try: set xmlDoc=Server.CreateObject("msxml2.DomDocument")
same error xmlDoc.async = false xmlDoc.preservewhitespace = false
sql = "SELECT * FROM test" rS.open sql, conn, adOpenStatic, adLockReadOnly, adCmdText
Nothing to do with your problem, but why use a static cursor? A forwardonly cursor is all you need:
set rs = conn.execute(sql,,adCmdText)
I would test rs for EOF before doing anything with it ...
rS.save xmlDoc, adPersistXML rS.close
Set conn = nothing Set rs = Nothing
----------------------------------------------------------- Any ideas? Thanks.
Pierre
"Kasp" <ka**@skynet.be> wrote in message
news:mn***********************@skynet.be... When I try and save out a recordset from an ASP page as XML I get the following error (the code is below) - I have ADO 2.8 installed and this is running on win XP sp2 :
----------------------------------------------------------
ADODB.Recordset error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
---------------------------------------------------------- Const adOpenStatic = 3 Const adLockReadOnly = 1 Const adCmdText = 1 Const adPersistXML = 1
Dim rS Dim conn Dim sql Dim xmlDoc
Set rS = Server.CreateObject ("ADODB.Recordset") Response.ContentType = "text/xml"
Set conn = Server.CreateObject("ADODB.Connection") conn.Open "DSN=Test;UID=sa;PWD="
set xmlDoc=Server.CreateObject("Microsoft.XmlDom") xmlDoc.async = false xmlDoc.preservewhitespace = false
sql = "SELECT * FROM test" rS.open sql, conn, adOpenStatic, adLockReadOnly, adCmdText rS.save xmlDoc, adPersistXML rS.close
Set conn = nothing Set rs = Nothing
----------------------------------------------------------- Any ideas? Thanks.
Pierre
I tested your code and it works. The only modifications I made where to the
connection string and the sql statement. I used a UDL file for the
connection string and used my own test table since you did not provide
details on your test table.
1. What database/version are you using?
2. What's the DDL (Data Definition Language) for the test table?
3. What provider are you using in your DSN entry for the "Test" database?
> "Kasp" <ka**@skynet.be> wrote in message news:mn***********************@skynet.be... When I try and save out a recordset from an ASP page as XML I get the following error (the code is below) - I have ADO 2.8 installed and this is running on win XP sp2 :
----------------------------------------------------------
ADODB.Recordset error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
---------------------------------------------------------- Const adOpenStatic = 3 Const adLockReadOnly = 1 Const adCmdText = 1 Const adPersistXML = 1
Dim rS Dim conn Dim sql Dim xmlDoc
Set rS = Server.CreateObject ("ADODB.Recordset") Response.ContentType = "text/xml"
Set conn = Server.CreateObject("ADODB.Connection") conn.Open "DSN=Test;UID=sa;PWD="
set xmlDoc=Server.CreateObject("Microsoft.XmlDom") xmlDoc.async = false xmlDoc.preservewhitespace = false
sql = "SELECT * FROM test" rS.open sql, conn, adOpenStatic, adLockReadOnly, adCmdText rS.save xmlDoc, adPersistXML rS.close
Set conn = nothing Set rs = Nothing
----------------------------------------------------------- Any ideas? Thanks.
Pierre
I tested your code and it works. The only modifications I made where to the connection string and the sql statement. I used a UDL file for the connection string and used my own test table since you did not provide details on your test table.
1. What database/version are you using?
Oracle 9.2
2. What's the DDL (Data Definition Language) for the test table?
what is a dll for a table?
3. What provider are you using in your DSN entry for the "Test" database?
Provider=MSDASQL.1;
Extended Properties="DSN=Test;UID=xxx;PWD=xxx;SERVER=Test;"
If I use this code in VB it is working !
If I save the record in a text file, it is working !!
[snip] 1. What database/version are you using?
Oracle 9.2
This was a pretty important piece of information missing from your original
post. More on this below. 2. What's the DDL (Data Definition Language) for the test table?
what is a dll for a table?
Not DLL, DDL. It stands for Data Definition Language. Specifically, can you
provide the "CREATE TABLE" statement for the "Test" table. That will let us
know what the datatype/sizes are for each of the columns in your table. Of
particular interest in this situation would be any columns that are mapped
as adVariant, adIDispatch or adIUnknown in ADO. There's a note in the
documentation for the Save method of the Recordset object about fields of
these datatypes not being supported. 3. What provider are you using in your DSN entry for the "Test" database?
Provider=MSDASQL.1; Extended Properties="DSN=Test;UID=xxx;PWD=xxx;SERVER=Test;"
Have you tried using the native Oracle provider instead of the Microsoft
Oracle provider?
If I use this code in VB it is working !
Can we see the code?
If I save the record in a text file, it is working !!
Can we see the code?
Kasp wrote: Kasp wrote: When I try and save out a recordset from an ASP page as XML I get the following error (the code is below) - I have ADO 2.8 installed and this is running on win XP sp2 :
----------------------------------------------------------
ADODB.Recordset error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
----------------------------------------------------------
Which line of code causes this error?
rS.save xmlDoc, adPersistXML
This is sounding like either an MDAC problem or a problem with the MSXML
parser, with the former being more likely. You should try upgrading both to
the latest versions. Run Component Checker (a download from Microsoft) to
verify that you have no MDAC problems on the server.
Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
> [snip] 1. What database/version are you using?
Oracle 9.2
This was a pretty important piece of information missing from your original post. More on this below.
2. What's the DDL (Data Definition Language) for the test table?
what is a dll for a table?
Not DLL, DDL. It stands for Data Definition Language. Specifically, can you provide the "CREATE TABLE" statement for the "Test" table. That will let us know what the datatype/sizes are for each of the columns in your table. Of particular interest in this situation would be any columns that are mapped as adVariant, adIDispatch or adIUnknown in ADO. There's a note in the documentation for the Save method of the Recordset object about fields of these datatypes not being supported.
where can I find this information? 3. What provider are you using in your DSN entry for the "Test" database?
Provider=MSDASQL.1; Extended Properties="DSN=Test;UID=xxx;PWD=xxx;SERVER=Test;"
Have you tried using the native Oracle provider instead of the Microsoft Oracle provider?
Yes If I use this code in VB it is working !
Can we see the code?
Private Sub Form_Load()
Dim szConnect As String
Dim SQL As String
szConnect = "Provider=MSDASQL;Data Source=xxx;User
Id=xxx;Password=xxx"
SQL = "SELECT * FROM bl"
Dim oRS As ADODB.Recordset
Dim oCN As ADODB.Connection
Set oCN = New ADODB.Connection
Set oRS = New ADODB.Recordset
With oCN
.CursorLocation = adUseClient
.ConnectionString = szConnect
.ConnectionTimeout = 5
.Open szConnect
End With
oRS.Open SQL, oCN
Dim xmlDoc As DOMDocument
Set xmlDoc = New DOMDocument
' To specify a specific version, use a declaration like the following,
with the appropriate version in the ProgID:
' Dim xmlDoc As MSXML2.DOMDocument40
' Set xmlDoc = New MSXML2.DOMDocument40
xmlDoc.async = False
oRS.Save xmlDoc, adPersistXML
If xmlDoc.parseError.errorCode <> 0 Then
MsgBox "Errors During Load" & vbCrLf &
xmlDoc.parseError.errorCode & xmlDoc.parseError.reason
Else
MsgBox xmlDoc.XML
End If
oRS.Close
oCN.Close
Set oRS = Nothing
Set oCN = Nothing
End Sub If I save the record in a text file, it is working !!
Can we see the code?
Const adOpenStatic = 3
Const adLockReadOnly = 1
Const adCmdText = 1
Const adPersistXML = 1
Dim rS
Dim conn
Dim sql
Set rS = Server.CreateObject ("ADODB.Recordset")
Response.ContentType = "text/xml"
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "DSN=Test;UID=sa;PWD="
sql = "SELECT * FROM test"
rS.open sql, conn, adOpenStatic, adLockReadOnly, adCmdText
rS.save "c:\\test.xml", adPersistXML
rS.close
Set conn = nothing
Set rs = Nothing
"Kasp" <ka**@skynet.be> wrote in message
news:mn***********************@skynet.be... [snip] 1. What database/version are you using?
Oracle 9.2
This was a pretty important piece of information missing from your original post. More on this below.
2. What's the DDL (Data Definition Language) for the test table?
what is a dll for a table?
Not DLL, DDL. It stands for Data Definition Language. Specifically, can you provide the "CREATE TABLE" statement for the "Test" table. That will let us know what the datatype/sizes are for each of the columns in your table. Of particular interest in this situation would be any columns that are mapped as adVariant, adIDispatch or adIUnknown in ADO. There's a note in the documentation for the Save method of the Recordset object about fields of these datatypes not being supported.
where can I find this information?
It's been some time since I used Oracle, but if I remember correctly, you go
to Enterprise Manager. Double click the table in the object tree on the
left, then select the "show sql" button on the properties dialog box that
comes up. 3. What provider are you using in your DSN entry for the "Test" database?
Provider=MSDASQL.1; Extended Properties="DSN=Test;UID=xxx;PWD=xxx;SERVER=Test;"
Have you tried using the native Oracle provider instead of the Microsoft Oracle provider?
Yes
I'll assume by "yes", you mean "yes, I tried the native driver and still got
the same error". If I use this code in VB it is working !
Can we see the code?
Private Sub Form_Load()
Dim szConnect As String Dim SQL As String
szConnect = "Provider=MSDASQL;Data Source=xxx;User Id=xxx;Password=xxx" SQL = "SELECT * FROM bl"
Dim oRS As ADODB.Recordset Dim oCN As ADODB.Connection
Set oCN = New ADODB.Connection Set oRS = New ADODB.Recordset
With oCN .CursorLocation = adUseClient .ConnectionString = szConnect .ConnectionTimeout = 5 .Open szConnect End With
oRS.Open SQL, oCN
Dim xmlDoc As DOMDocument Set xmlDoc = New DOMDocument
' To specify a specific version, use a declaration like the following, with the appropriate version in the ProgID: ' Dim xmlDoc As MSXML2.DOMDocument40 ' Set xmlDoc = New MSXML2.DOMDocument40
xmlDoc.async = False oRS.Save xmlDoc, adPersistXML
If xmlDoc.parseError.errorCode <> 0 Then MsgBox "Errors During Load" & vbCrLf & xmlDoc.parseError.errorCode & xmlDoc.parseError.reason Else MsgBox xmlDoc.XML End If
oRS.Close oCN.Close Set oRS = Nothing Set oCN = Nothing
End Sub
You are using a different connection string in this code. If I save the record in a text file, it is working !!
Can we see the code?
Const adOpenStatic = 3 Const adLockReadOnly = 1 Const adCmdText = 1 Const adPersistXML = 1
Dim rS Dim conn Dim sql
Set rS = Server.CreateObject ("ADODB.Recordset") Response.ContentType = "text/xml"
Set conn = Server.CreateObject("ADODB.Connection") conn.Open "DSN=Test;UID=sa;PWD="
sql = "SELECT * FROM test" rS.open sql, conn, adOpenStatic, adLockReadOnly, adCmdText rS.save "c:\\test.xml", adPersistXML rS.close
Set conn = nothing Set rs = Nothing
Have you checked the resulting test.xml file?
> "Kasp" <ka**@skynet.be> wrote in message news:mn***********************@skynet.be... [snip] > 1. What database/version are you using? >
Oracle 9.2
This was a pretty important piece of information missing from your original post. More on this below.
> 2. What's the DDL (Data Definition Language) for the test table? >
what is a dll for a table?
Not DLL, DDL. It stands for Data Definition Language. Specifically, can you provide the "CREATE TABLE" statement for the "Test" table. That will let us know what the datatype/sizes are for each of the columns in your table. Of particular interest in this situation would be any columns that are mapped as adVariant, adIDispatch or adIUnknown in ADO. There's a note in the documentation for the Save method of the Recordset object about fields of these datatypes not being supported.
where can I find this information?
It's been some time since I used Oracle, but if I remember correctly, you go to Enterprise Manager. Double click the table in the object tree on the left, then select the "show sql" button on the properties dialog box that comes up.
> 3. What provider are you using in your DSN entry for the "Test" > database?
Provider=MSDASQL.1; Extended Properties="DSN=Test;UID=xxx;PWD=xxx;SERVER=Test;"
Have you tried using the native Oracle provider instead of the Microsoft Oracle provider?
Yes
I'll assume by "yes", you mean "yes, I tried the native driver and still got the same error".
If I use this code in VB it is working !
Can we see the code?
Private Sub Form_Load()
Dim szConnect As String Dim SQL As String
szConnect = "Provider=MSDASQL;Data Source=xxx;User Id=xxx;Password=xxx" SQL = "SELECT * FROM bl"
Dim oRS As ADODB.Recordset Dim oCN As ADODB.Connection
Set oCN = New ADODB.Connection Set oRS = New ADODB.Recordset
With oCN .CursorLocation = adUseClient .ConnectionString = szConnect .ConnectionTimeout = 5 .Open szConnect End With
oRS.Open SQL, oCN
Dim xmlDoc As DOMDocument Set xmlDoc = New DOMDocument
' To specify a specific version, use a declaration like the following, with the appropriate version in the ProgID: ' Dim xmlDoc As MSXML2.DOMDocument40 ' Set xmlDoc = New MSXML2.DOMDocument40
xmlDoc.async = False oRS.Save xmlDoc, adPersistXML
If xmlDoc.parseError.errorCode <> 0 Then MsgBox "Errors During Load" & vbCrLf & xmlDoc.parseError.errorCode & xmlDoc.parseError.reason Else MsgBox xmlDoc.XML End If
oRS.Close oCN.Close Set oRS = Nothing Set oCN = Nothing
End Sub
You are using a different connection string in this code.
If I save the record in a text file, it is working !!
Can we see the code?
Const adOpenStatic = 3 Const adLockReadOnly = 1 Const adCmdText = 1 Const adPersistXML = 1
Dim rS Dim conn Dim sql
Set rS = Server.CreateObject ("ADODB.Recordset") Response.ContentType = "text/xml"
Set conn = Server.CreateObject("ADODB.Connection") conn.Open "DSN=Test;UID=sa;PWD="
sql = "SELECT * FROM test" rS.open sql, conn, adOpenStatic, adLockReadOnly, adCmdText rS.save "c:\\test.xml", adPersistXML rS.close
Set conn = nothing Set rs = Nothing
Have you checked the resulting test.xml file?
I found the problem ... It was permition access to the ora92 directory.
Thank you.
--
Pierre
Kasp wrote: I found the problem ... It was permition access to the ora92 directory.
Really??? That usually gives me an "Access Denied" error which is why I
never even considered permissions to be the cause of your issue.
Wait a minute ... you have totally lost me. You are saying that you were
unable to save a recordset to an object that was in memory because of lack
of permissions to a filesystem directory?? Something is not right here ...
Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM" This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Alan Silver |
last post by:
Hello,
I have an ASP that takes a connection string and SQL statement in the
querystring and is supposed to return the XML representation of the
recordset to the Response stream (don't worry,...
|
by: Nathan Bloomfield |
last post by:
Hi there,
I am having difficulty with a piece of code which would work wonders
for my application if only the error trapping worked properly.
Basically, it works as follows:
- adds records...
|
by: Ray Holtz |
last post by:
I have a database in Access 2003 (Access2000 file format). There are
two tables that are being used: Employees and Items. It is linked by
the Employee field so that one employee can have many...
|
by: pierre.saucin |
last post by:
When I try and save out a recordset from an ASP page as XML I get the
following error (the code is below) - I have ADO 2.8 installed and this
is running on win XP sp2 :
...
|
by: technocraze |
last post by:
Hi guys,
I have encountered this error when updating the values to the MS Acess table.
Error : Update on linked table failed. ODBC sql server error Timeout expired. MS Acess is my front end and...
|
by: ADezii |
last post by:
Most Access Users realize that Recordsets, being virtual representations of a Query, Table, or SQL Statement, exist only in our PC's memory. They, and the data they contain, literally exist at one...
|
by: shank |
last post by:
On this page...
http://www.w3schools.com/ado/met_rs_save.asp
....it describes how to save a recordset to file with the following...
You can save a Recordset in XML format:
<%
set...
|
by: ADezii |
last post by:
When you create an ADO Recordset, you should have some idea as to what functionality the Recordset does/does not provide. Some critical questions may, and should, be:
Can I add New Records to the...
|
by: Harvey Triana |
last post by:
Hello -
I am migrating a large COM system solution to ASP.NET
To transfer data from Web to client this application uses streams of ADO
recordset, example:
Clasic ASP (VB Script):
<%
Dim Rs...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |