Please help---urgent!!

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Aug 2008
Posts: 15
Reputation: iamdaniel123 is an unknown quantity at this point 
Solved Threads: 0
iamdaniel123 iamdaniel123 is offline Offline
Newbie Poster

Please help---urgent!!

 
0
  #1
Aug 24th, 2008
Is it possible to open a hyperlink and display the data in a label or text box?

I have a table in Access where the data type of a record is a hyperlink. I would like to open that hyperlink and display the data in a label or text box.

It is for a school project and so quick responses would really be appreciated. I'm also sorry as this is my second thread on the matter, but no one replied to the last thread. Hopefully you can understand the urgency.

Thank you
Daniel.
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 102
Reputation: Don Gino is an unknown quantity at this point 
Solved Threads: 2
Don Gino's Avatar
Don Gino Don Gino is offline Offline
Junior Poster

Re: Please help---urgent!!

 
0
  #2
Aug 24th, 2008
Hi Daniel,

When you mean data do you mean the webpage itself? If you want a webpage to be displayed within VB follow the instructions of this link:
http://www.trap17.com/index.php/how-...er_t31604.html
Last edited by Don Gino; Aug 24th, 2008 at 8:04 pm.
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 15
Reputation: iamdaniel123 is an unknown quantity at this point 
Solved Threads: 0
iamdaniel123 iamdaniel123 is offline Offline
Newbie Poster

Re: Please help---urgent!!

 
0
  #3
Aug 24th, 2008
no. its actually a text file.
hmmm...its hard to explain!
the user inputs the directory they would like to save the text file, the program saves that directory in access as a hyperlink. then, the user can access the file through the hyperlink?
..is it possible?!
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 304
Reputation: aktharshaik is an unknown quantity at this point 
Solved Threads: 37
aktharshaik's Avatar
aktharshaik aktharshaik is offline Offline
Posting Whiz

Re: Please help---urgent!!

 
0
  #4
Aug 25th, 2008
s. u can use the file system object and textstream to open a textfile, read the data and display it in a lable or a textbox.

Add the Microsoft Scripting Runtime in the References. Create objects of the following.
FileSystemObject and TextStream


Try out these, if u still cant make the code then 'll be there to help u out.

Regards
Shaik Akthar
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 15
Reputation: iamdaniel123 is an unknown quantity at this point 
Solved Threads: 0
iamdaniel123 iamdaniel123 is offline Offline
Newbie Poster

Re: Please help---urgent!!

 
0
  #5
Aug 25th, 2008
thank you soo much shaik for your time and help!...but i'm still unsure on how to open the text file from the hyperlink in my access database?....

cheers
Daniel
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 304
Reputation: aktharshaik is an unknown quantity at this point 
Solved Threads: 37
aktharshaik's Avatar
aktharshaik aktharshaik is offline Offline
Posting Whiz

Re: Please help---urgent!!

 
0
  #6
Aug 25th, 2008
Open the recordset. Extract the field with hyperlink and connect it to the File System Object and TextStream

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. Dim rs as New ADODB.Recordset
  2. Dim FSO As New FileSystemObject
  3. Dim FL As TextStream
  4.  
  5. rs.Open "SELECT hLinkField FROM MYTABLE WHERE ID = 1", con,adopenKeySet, adLockReadOnly
  6.  
  7. 'If record found then
  8. If rs.BOF = False Then
  9. 'open the file in the field which contains
  10. 'the hyperlink to the textfile
  11. Set FL=FSO.OpenTextFile(rs!hLinkField, & _
  12. ForReading, False)
  13. Text1.Text = ""
  14. While Not FL.AtEndOfStream
  15. Text1.Text = Text1.Text & FL.ReadLine
  16. Wend
  17. FL.Close
  18. End If
  19.  
  20. Set FL = Nothing
  21. Set FSO = Nothing

Regards
Shaik Akthar
Last edited by aktharshaik; Aug 25th, 2008 at 1:24 am.
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 304
Reputation: aktharshaik is an unknown quantity at this point 
Solved Threads: 37
aktharshaik's Avatar
aktharshaik aktharshaik is offline Offline
Posting Whiz

Re: Please help---urgent!!

 
0
  #7
Aug 25th, 2008
Here I assume u know how to connect to your database. i have considered ADODB.Connection object "con" which is global and already attached to the database.

Regards
Shaik Akthar
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 15
Reputation: iamdaniel123 is an unknown quantity at this point 
Solved Threads: 0
iamdaniel123 iamdaniel123 is offline Offline
Newbie Poster

Re: Please help---urgent!!

 
0
  #8
Aug 25th, 2008
thank you shaik, i used that code but it says there is a complie error: User-defined type not defined...with
fso As New FileSystemObject highlighted

???
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 15
Reputation: iamdaniel123 is an unknown quantity at this point 
Solved Threads: 0
iamdaniel123 iamdaniel123 is offline Offline
Newbie Poster

Re: Please help---urgent!!

 
0
  #9
Aug 25th, 2008
Originally Posted by aktharshaik View Post
Here I assume u know how to connect to your database. i have considered ADODB.Connection object "con" which is global and already attached to the database.

Regards
Shaik Akthar
um...to connect my database...
Set db = OpenDatabase(App.Path & "\database.mdb")
Set rst = db.OpenRecordset("table")
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 15
Reputation: iamdaniel123 is an unknown quantity at this point 
Solved Threads: 0
iamdaniel123 iamdaniel123 is offline Offline
Newbie Poster

Re: Please help---urgent!!

 
0
  #10
Aug 25th, 2008
sorry...i forgot to add the reference. but now an error message comes up saying
Run-Time error 438:
Object does not support this property or method with
rst.Open "SELECT hLinkField....." highlighted.
so, i don't know what to do!

???

cheers
Daniel
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC