Solved

Why am i getting this error:ADODB.Command (0x800A0E7D)

Posted on 2004-10-14
5
769 Views
Last Modified: 2007-11-27
Why am i getting this error:
Error Type:
ADODB.Command (0x800A0E7D)
Requested operation requires an OLE DB Session object, which is not supported by the current provider.
/DIET/forum/diet/swiffchart.asp, line 26

Here is the asp file:
<%@Language = VBScript %>
 <%' use this meta tag instead of adovbs.inc%>
 <!--METADATA TYPE="typelib" uuid="00000205-0000-0010-8000-00AA006D2EA4" -->
 <%
    Response.Expires= 0
    Dim currentweight, d_date
    Dim Cnxn, strCnxn
    Dim rs, strSQL
          strCnxn= "db1.mdb"
    strCnxn= "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & strCnxn
    Set Cnxn= Server.CreateObject("ADODB.Connection")
    Cnxn.Open strCnxn,1,3,1
    Set Cmd= Server.CreateObject("ADODB.Command")
    Cmd.ActiveConnection= Cnxn
    strSQL = "SELECT * From Weight"
    Cmd.CommandText = strSQL
    Set rs= Cmd.Execute
    currentweight = ""
    d_date = ""
     rs.MoveFirst
    While Not rs.EOF
       currentweight = currentweight & rs.Fields(0).Value & ";"
       d_date = d_date & rs.Fields(1).Value & ";"
       rs.MoveNext
    Wend
    Cnxn.Close
    Set Cmd = Nothing
    Set rs = Nothing
    Set Cnxn = Nothing
    currentweight = Left(currentweight, Len(currentweight) - 1)
    d_date = Left(d_date, Len(d_date) - 1)
      Dim chart
    Set chart= Server.CreateObject("SwiffChartObject.ChartObj")
    chart.SetSeriesCaption 0, "Weight"
    chart.SetSeparators ";", true
    chart.SetcurrentweightFromString currentweight
    chart.SetSeriesd_dateFromString 0, d_date
       chart.SetTitle "Weight chart"
       chart.LoadStyle "swiff.scs"
    chart.ExportAsResponse
      Set chart= Nothing
    Response.End
%>
0
Comment
Question by:Melfeky
  • 3
5 Comments
 
LVL 26

Assisted Solution

by:Hilaire
Hilaire earned 200 total points
ID: 12316661
try
Cnxn.Open strCnxn
instead of
Cnxn.Open strCnxn,1,3,1
0
 
LVL 26

Expert Comment

by:Hilaire
ID: 12316716
taken apart that 1 and 3 are very unlikely to be a user and a password,
the allowed values for the fourth parameter of the connection.open method are the possible vlues of ConnectOptionEnum : -1 (default, synchronous) and 16 (asynchronous)

I guess the 1,3,1 is a remain from a copied line (conn.execute strstr, 1,3,1 is more familiar ;-))
0
 
LVL 26

Expert Comment

by:Hilaire
ID: 12316742
in fact I think the correct syntax is

Call Cnxn.Open(strCnxn)
0
 
LVL 28

Assisted Solution

by:sybe
sybe earned 150 total points
ID: 12317264
>> Call Cnxn.Open(strCnxn)

This is identical to "Cnxn.Open strCnxn", calling a sub in VB can be done in 3 ways

<%
Call MySub(parameter1, parameter2)
%>

<%
MySub parameter1, parameter2
%>

And if the sub requires zero or one parameter, then this will also work:

<%
MySub(parameter1)
%>

Only when the more then 1 parameters are passed to a Sub, then this will give an error:
<%
MySub(parameter1, parameter2)
%>

VB isn't very clear always, i guess that all this is a remainder from good old BASIC
0
 
LVL 4

Accepted Solution

by:
carlmahon earned 150 total points
ID: 12322104
Do you need to use ADODB.Command?

Try:
strSQL = "SELECT * From Weight"
Set rs =  Cnxn.Execute(strSQL)

Carl
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Help with stored procedure 30 59
Why Bundles is not working on certain files - ASP MVC 3 44
SQL to update characters in table column 6 85
Questions about INCLUDE FILES 2 19
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now