|
-
September 12th, 2001, 03:42 AM
#1
Html
I want to save html source code into Acess database using VB
-
September 12th, 2001, 04:05 AM
#2
Re: Html
Hi friend,
just add the Mircorsft internet transfer control in ur VB form.
and add the textbox and make it multiline property = true
then write the code.
Text1.Text = Intel.OpenURL("http://www.yahoo.com")
it'll store the all source code to textbox
from text box u can update to database
thanks
Bala
Prelude Solution Providers (P) Ltd.
Chennai.India
-
September 12th, 2001, 04:26 AM
#3
Re: Html
'The other solution seems really great and simple.
'Here you havee an example of another way:
'this is a starting point for your operations
'you may do better, ie with reading in binary format...
option Explicit
'a reference to Microsoft activex 2.0 (or higher) object library
private cnn as ADODB.Connection
private Sub Command1_Click()
Dim allFileText, textVar
Dim strConn as string
Dim strSql as string
'your path to and name of page html
Open "d:\Impe\CodeTips\Htm\myHtmPage.htm" for input as #1
Do While EOF(1) = false
Line input #1, textVar
allFileText = allFileText & vbCrLf & textVar
Loop
Close #1
'coonection string: you will have to provide yours
strConn = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=false;Data Source=D:\Impe\CodeTips\Htm\mydb1.mdb"
'this is a non acceptable char "|" so substitute it with "~"
'while reading from db, remember to convert all "~" in "|" back
allFileText = Replace(allFileText, "|", "~")
'while reading/writing, you may find other chars not accepted...
'insert your page in a memo field odf a db with an ID field autoincrement
strSql = "Insert into Thtm (TextHtm) values (" & "'" & allFileText & "'" & ")"
set cnn = new ADODB.Connection
cnn.Open strConn
cnn.Execute (strSql)
cnn.Close
set cnn = nothing
End Sub
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
September 12th, 2001, 05:54 AM
#4
Re: Html
Thanx a lot its working good
Nitya
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|