Home > Archive > ASP > March 2005 > prob with ado reading http://
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
prob with ado reading http://
|
|
|
| Hello,
I keep getting a runtime error with the following ado
routine that I run from a VB6 app - note: I tried it with
ref to mdac2.6 and mdac2.7 and mdac2.8. This worked once,
but it doesn't work anymore. I think I changed something,
either in the code or on the system. It crashes at
rs.Open...
mylocattest.txt is a simple text file with one line of
text. I can see it at http://localhost/mylocaltest.txt
Could anyone suggest what the problem might be? Maybe the
wrong args for rs.Open...?
Public Sub HttpData()
Dim Cnxn As ADODB.Connection, strCnxn As String
Dim rs As ADODB.Record, strFile As String
Set rs = New ADODB.Record
Set Cnxn = New ADODB.Connection
'strCnxn = "url=http://localhost/"
strCnxn = "url=http://myServerName/"
Cnxn.Open strCnxn
strFile = "mylocaltest.txt"
rs.Open strFile, Cnxn, adModeRead, adOpenIfExists
'rcFile.Open "http://cnfrkccmc001/mylocaltest.txt", ,
adModeRead, adOpenIfExists
rs.Close
Cnxn.Close
End Sub
Thanks,
Ron
| |
| Bob Barrows [MVP] 2005-03-24, 3:55 pm |
| Ron wrote:
> Hello,
>
> I keep getting a runtime error with the following ado
> routine that I run from a VB6 app - note: I tried it with
> ref to mdac2.6 and mdac2.7 and mdac2.8. This worked once,
> but it doesn't work anymore. I think I changed something,
> either in the code or on the system. It crashes at
> rs.Open...
Define "crashes". Error messages? We're not looking over your shoulder while
you're testing ...
>
> mylocattest.txt is a simple text file with one line of
> text. I can see it at http://localhost/mylocaltest.txt
>
> Could anyone suggest what the problem might be? Maybe the
> wrong args for rs.Open...?
>
> Public Sub HttpData()
> Dim Cnxn As ADODB.Connection, strCnxn As String
> Dim rs As ADODB.Record, strFile As String
>
> Set rs = New ADODB.Record
> Set Cnxn = New ADODB.Connection
> 'strCnxn = "url=http://localhost/"
> strCnxn = "url=http://myServerName/"
> Cnxn.Open strCnxn
> strFile = "mylocaltest.txt"
> rs.Open strFile, Cnxn, adModeRead, adOpenIfExists
> 'rcFile.Open "http://cnfrkccmc001/mylocaltest.txt", ,
> adModeRead, adOpenIfExists
Where did you find that adOpenIfExists constant? I see no reference to it in
any documentation I can find. See for yourself:
http://msdn.microsoft.com/library/e...dmthrstopen.asp
In fact, that adModeRead constant is not valid in a recordset Open statement
either. That constant is used to set the Mode property of a connection
object, something which cannot be done in a recordset Open statement.
Read the documentation in the link I provided to discover what the valid
constants are.
Bob Barrows
--
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.
| |
|
| Thanks very much for your reply and for the refernce
site. I am checking out your reference site. But I was
emulating an example that I got from
http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/ado270/htm/mdmthdeleterecordvbx.asp
Also, for the constants that I used in my sample routine,
I picked the constant(s) from the dropdown box that
followed each comma. These constants probably apply to an
ADODB.Record object which is what I dimmed rs as -
ADODB.Record. I tried changing it to ADODB.Recordset, but
still no luck. My sample worked once. I left it for a
few days, came back to it, and no longer working. I will
keep studying your reference site and hopefully a light
will come on. But if you could see what would make my
sample work (what the correct constants would be) may I
request your enlightenment?
Regards,
Ron
>-----Original Message-----
>Ron wrote:
with[color=darkred]
once,[color=darkred]
something,[color=darkred]
>
>Define "crashes". Error messages? We're not looking over
your shoulder while
>you're testing ...
>
the[color=darkred]
>
>Where did you find that adOpenIfExists constant? I see no
reference to it in
>any documentation I can find. See for yourself:
>http://msdn.microsoft.com/library/en-
us/ado270/htm/mdmthrstopen.asp
>
>In fact, that adModeRead constant is not valid in a
recordset Open statement
>either. That constant is used to set the Mode property of
a connection
>object, something which cannot be done in a recordset
Open statement.
>
>Read the documentation in the link I provided to discover
what the valid
>constants are.
>
>Bob Barrows
>
>
>--
>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.
>
>
>.
>
| |
| Bob Barrows [MVP] 2005-03-24, 3:55 pm |
| I missed the fact that you were attempting to use a Record rather than a
Recordset. The link I provided is not relevant
I'm going to reiterate my request for further details about what you mean by
"crash". I'm also going to suggest posting to a VB group rather than an ASP
group. It's fairly well off-topic here.
Ron wrote:[color=darkred]
> Thanks very much for your reply and for the refernce
> site. I am checking out your reference site. But I was
> emulating an example that I got from
>
> http://msdn.microsoft.com/library/default.asp?
> url=/library/en-us/ado270/htm/mdmthdeleterecordvbx.asp
>
> Also, for the constants that I used in my sample routine,
> I picked the constant(s) from the dropdown box that
> followed each comma. These constants probably apply to an
> ADODB.Record object which is what I dimmed rs as -
> ADODB.Record. I tried changing it to ADODB.Recordset, but
> still no luck. My sample worked once. I left it for a
> few days, came back to it, and no longer working. I will
> keep studying your reference site and hopefully a light
> will come on. But if you could see what would make my
> sample work (what the correct constants would be) may I
> request your enlightenment?
>
> Regards,
> Ron
>
--
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.
| |
|
| Yes. I did think about off topic. But I was also was
thinking http://... so I thought an asp group might be a
place where someone had done this before. Anyway, I thank
you again for your replies. Now I don't feel so bad
because my problem appears to be not as simple (as I was
hoping it would be).
As for crashing, I mean I get a debug error - one of those
meaningless ones - at the rs.Open... line. I had it
working once, then I left it for a few days, something on
IIS or IE maybe changed when I loaded mdac2.8 (I loaded
mdac2.8 on the iterim), who knows what, now the code
doens't run. then I started tweaking the code - to no
avail. Well, I will try a vb group as you suggest.
>-----Original Message-----
>I missed the fact that you were attempting to use a
Record rather than a
>Recordset. The link I provided is not relevant
>
>I'm going to reiterate my request for further details
about what you mean by
>"crash". I'm also going to suggest posting to a VB group
rather than an ASP
>group. It's fairly well off-topic here.
>
>Ron wrote:
routine,[color=darkred]
an[color=darkred]
but[color=darkred]
will[color=darkred]
with[color=darkred]
once,[color=darkred]
something,[color=darkred]
over your[color=darkred]
http://localhost/mylocaltest.txt[color=darkred]
Maybe the[color=darkred]
,[color=darkred]
>
>--
>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.
>
>
>.
>
|
|
|
|
|