473,804 Members | 3,194 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

prob with ado reading http://

Ron
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.Connectio n, strCnxn As String
Dim rs As ADODB.Record, strFile As String

Set rs = New ADODB.Record
Set Cnxn = New ADODB.Connectio n
'strCnxn = "url=http://localhost/"
strCnxn = "url=http://myServerName/"
Cnxn.Open strCnxn
strFile = "mylocaltest.tx t"
rs.Open strFile, Cnxn, adModeRead, adOpenIfExists
'rcFile.Open "http://cnfrkccmc001/mylocaltest.txt ", ,
adModeRead, adOpenIfExists
rs.Close
Cnxn.Close
End Sub

Thanks,
Ron
Jul 22 '05 #1
4 1431
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.Connectio n, strCnxn As String
Dim rs As ADODB.Record, strFile As String

Set rs = New ADODB.Record
Set Cnxn = New ADODB.Connectio n
'strCnxn = "url=http://localhost/"
strCnxn = "url=http://myServerName/"
Cnxn.Open strCnxn
strFile = "mylocaltest.tx t"
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/en...mthrstopen.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.
Jul 22 '05 #2
Ron
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/mdmthdeletereco rdvbx.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:
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 whileyou'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.Connectio n, strCnxn As String
Dim rs As ADODB.Record, strFile As String

Set rs = New ADODB.Record
Set Cnxn = New ADODB.Connectio n
'strCnxn = "url=http://localhost/"
strCnxn = "url=http://myServerName/"
Cnxn.Open strCnxn
strFile = "mylocaltest.tx t"
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 inany documentation I can find. See for yourself:
http://msdn.microsoft.com/library/en- us/ado270/htm/mdmthrstopen.as p
In fact, that adModeRead constant is not valid in a recordset Open statementeither. That constant is used to set the Mode property of a connectionobject, something which cannot be done in a recordset Open statement.
Read the documentation in the link I provided to discover what the validconstants are.

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my Fromheader is my spam trap, so I don't check it very often. You will get aquicker response by posting to the newsgroup.
.

Jul 22 '05 #3
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:
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/mdmthdeletereco rdvbx.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:
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.Connectio n, strCnxn As String
Dim rs As ADODB.Record, strFile As String

Set rs = New ADODB.Record
Set Cnxn = New ADODB.Connectio n
'strCnxn = "url=http://localhost/"
strCnxn = "url=http://myServerName/"
Cnxn.Open strCnxn
strFile = "mylocaltest.tx t"
rs.Open strFile, Cnxn, adModeRead, adOpenIfExists
'rcFile.Open "http://cnfrkccmc001/mylocaltest.txt ", ,
adModeRead, adOpenIfExists


--
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.
Jul 22 '05 #4
Ron
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 aRecordset. 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 ASPgroup. It's fairly well off-topic here.

Ron wrote:
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/mdmthdeletereco rdvbx.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:
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.Connectio n, strCnxn As String
Dim rs As ADODB.Record, strFile As String

Set rs = New ADODB.Record
Set Cnxn = New ADODB.Connectio n
'strCnxn = "url=http://localhost/"
strCnxn = "url=http://myServerName/"
Cnxn.Open strCnxn
strFile = "mylocaltest.tx t"
rs.Open strFile, Cnxn, adModeRead, adOpenIfExists
'rcFile.Open "http://cnfrkccmc001/mylocaltest.txt ", , adModeRead, adOpenIfExists

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed

in my Fromheader is my spam trap, so I don't check it very often. You will get aquicker response by posting to the newsgroup.
.

Jul 22 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4777
by: Bill S. | last post by:
Hi, I a stored procedure that inserts a record into a table as below. The insert works OK, but if the insert violates a unique indewx constraint on one of the columns, the proc terminates immediately, and does NOT execute the 'if @@ERROR <> 0' statement.
1
1332
by: Mike | last post by:
I'm having a problem with one on my page - http://www.angelfire.com/il/1redyns/jumpbox.html All the menus on the page work, the last one on the page can't even be seen though. It's code is there on the page though. I cut and pasted the code, it's the same code as the rest on that page. If anyone can help, please do. It's driving me crazy!!! Thanks,
5
2386
by: david hepworth | last post by:
I am in the process of creating a CSS tab style thing for my webpage. I have everything as i wish except that i cannot center the damn thing in the page. I am hoping someone out there can help. I am sure that it is a silly mistake but i have been staring at it for so long i am going stir-crazy! I have tried 'text-align: center;' in most parts of the CSS and in the div in the HTML but it does not like it. This is my CSS:...
1
21396
by: Junior | last post by:
I keep receiving this "The type or namespace name 'CASsEventHandler' could not be found (are you missing a using directive or an assembly reference?)" message in two particular lines, and I've tried everything... Could anyone please paste this and tell me what I'm doing wrong ? I use SerialPort.zip, which can be downloaded at http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=b06e30f9-1301-4cc6-ac14-dfe325097c69 ...
28
2733
by: Vishal Naidu | last post by:
i m new to the C world... i ve been told by my instructors not to use goto stmt.. but no one could give me a satisfactory answer as to why it is so.. plz help me out of this dilemma, coz i use a lot of goto in my codes....
2
1484
by: Rashrashetta | last post by:
Hai all, I am trying to read and write to an excel sheet using C# in a webform... I'v read alot of tutorials and used it...it works BUT ONLY ONCE...Especially when writing to the sheet... I mean when I want to read its fine.... But when I write to the sheet...first time it does...but after I open it ( to see the result manually )...close it...and try to write again, it gives me an error ( configuration error ) and says "Access
4
1893
by: Jeff User | last post by:
Hello I am hoping someone knows the answers I seek.. I am writing code in a C# web service solution. I want to create an instance of an object (that I created) in a Session variable. I need to check to see if the Session variable has been set yet. If the variable already contains an instance of this object then I will retrieve and use the existing object, rather than create a new instance. ie. I will only create a new object the first...
5
1651
by: Mutant Merv | last post by:
Hi, As I mentioned in the Introduction Forum I am full of enthusiasm but very low on Knowledge. Using Sams HTML & XHTML book I am slowly reading and understanding the use of HTML but already I have a slight problem. I have made up a sample HTML document just to check that what I have read I have understood...please see belowe: <html> <head><title>The first web page</title></head>
15
1496
by: the consiglieri | last post by:
hello there .. im not much an expert in C....im trying to use int** for reperesentation of matrices(as double subscripted arrays .)but at run time an error occurs ..saying ...general exception error ...processor fault ....im using TURBO C v4.5 so plzif any body could help me
0
9706
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9579
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10332
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10321
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7620
isladogs
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6853
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3820
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2991
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.