by مصطفى ناعورة,mustafa naura (1 Submission)
Category: Databases/Data Access/DAO/ADO
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 5th January 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)
this program read from text files an sql statment and auto insert into database just you need adodc , richtext name as rtext1 and buttons
Private Sub Command2_Click()
End
End Sub
Private Sub Command3_Click()
Dim SQLstr As String
Set cmd = New ADODB.Command
rtext1.LoadFile "d:\rcompanies\1.txt"
X = rtext1.Text
With cmd
k = 0
Do While Len(X) > 10
pos = InStr(1, X, ";")
X = Right(X, Len(X) - pos)
k = k + 1
Loop
rtext1.LoadFile "d:\companies\1.txt"
X = rtext1.Text
bar1.Max = k + 1
bar1.Value = 1
Do While Len(X) > 10
pos = InStr(1, X, ";")
Data = Left(X, pos)
Data = Trim(Data)
X = Right(X, Len(X) - pos)
.ActiveConnection = Adodc1.ConnectionString
.CommandType = adCmdText
.CommandText = Data
.Execute
rtext1.Text = X
rtext1.SaveFile "d:\qatarcompanies\2.txt"
Adodc1.Refresh
DataGrid1.ReBind
Sleep 1000
bar1.Value = bar1.Value + 1
DoEvents
Loop
End With
End Sub
No comments have been posted about this program read from text files an sql statment and auto insert into database just you need adodc. Why not be the first to post a comment about this program read from text files an sql statment and auto insert into database just you need adodc.