Click here to Skip to main content
16,004,901 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Do Loop problem with MSAgent Pin
Dave Kreskowiak11-Oct-04 15:21
mveDave Kreskowiak11-Oct-04 15:21 
GeneralPrintPrivew Problem in MDI Form Pin
szaidi7-Oct-04 12:06
szaidi7-Oct-04 12:06 
GeneralRe: PrintPrivew Problem in MDI Form Pin
szaidi8-Oct-04 4:39
szaidi8-Oct-04 4:39 
GeneralRS-232 event Pin
mannett7-Oct-04 8:52
mannett7-Oct-04 8:52 
GeneralRe: RS-232 event Pin
Dave Kreskowiak7-Oct-04 10:11
mveDave Kreskowiak7-Oct-04 10:11 
GeneralFor Next issues Pin
KreativeKai7-Oct-04 7:09
professionalKreativeKai7-Oct-04 7:09 
Generaladd subreport in crystal report Pin
nitin_ion6-Oct-04 21:11
nitin_ion6-Oct-04 21:11 
Generaladd txt file to sql db using vb6.0 Pin
Mohammed Bassam Dab'an6-Oct-04 19:54
sussMohammed Bassam Dab'an6-Oct-04 19:54 
i want to add a txt file to sql db using vb6.0 how i can do it
i used this code but failed why
CODE...............--->
Option Explicit
Dim mfso As New FileSystemObject
Dim fPath As File
Private machinename As String
Public Cmd As New ADODB.Command
Public CN As New ADODB.Connection
Public RS As New ADODB.Recordset


Private Sub Command4_Click()
Dim filePath, txtFilePath, test As String
Dim i, result As Integer
i = List1.ListIndex
Dim jj As String
Dim strContent As String
Dim txtmachinename, tableName As String
machinename = String(50, " ")
Call MachineSpecificInfo.GetComputerName(machinename, Len(machinename))
txtmachinename = Left(machinename, InStr(Trim(machinename), Chr(0)) - 1)
machinename = vbNullString
On Error Resume Next
CN.ConnectionString = "Provider='" & "SQLOLEDB.1" & "' ;User id='" & "sa" & "' ;password='" & "" & "' ;Persist Security info='" & "false" & "' ; Data Source='" & txtmachinename & "' ;Connect Timeout=0; Initial Catalog='" & "darpg" & "'"
CN.Open
RS.CursorType = adOpenDynamic
RS.LockType = adLockOptimistic
RS.CursorLocation = adUseClient
tableName = "pdbftsdata"
RS.Open "Select max(FTSIndex) from pdbftsdata", CN
Dim maxx As Integer
maxx = RS(0)
maxx = maxx + 1
result = InStr(1, List1.List(i), "_")
DocId = Left$(List1.List(i), result - 1)
DocId = 13
MsgBox DocId
'Set fPath = mfso.GetFile(txtFilePath)
Set fPath = mfso.GetFile("C:\Documents and Settings\mdabaan\Desktop\Last Project\TXTFolder\a.txt")
Set objTextStream = fPath.OpenAsTextStream(ForReading)

strContent = objTextStream.ReadAll
'result = Len(strContent)
Dim textShow As String

MsgBox strContent

textShow = Replace(strContent, vbCrLf, " ")
objTextStream.Close
MsgBox textShow
Dim ss As String
ss = textShow
RichTextBox1.Text = ss

MsgBox Len(ss)
CN.Execute "INSERT INTO pdbftsdata(Documentindex,data) values('" & DocId & "','" & ss & "')"

CN.Close
'------------
List1.RemoveItem (i)
'List2.RemoveItem (i)
' End If
'End If
End Sub

Thanks alot
Metal Man
Generaladd text file to sql database, VB6.0 Pin
Mohammad Daba'an6-Oct-04 19:36
Mohammad Daba'an6-Oct-04 19:36 
GeneralRe: add text file to sql database, VB6.0 Pin
Dave Kreskowiak7-Oct-04 0:30
mveDave Kreskowiak7-Oct-04 0:30 
GeneralRe: add text file to sql database, VB6.0 Pin
Mohammad Daba'an7-Oct-04 2:45
Mohammad Daba'an7-Oct-04 2:45 
GeneralRe: add text file to sql database, VB6.0 Pin
Mohammad Daba'an7-Oct-04 4:08
Mohammad Daba'an7-Oct-04 4:08 
GeneralRe: add text file to sql database, VB6.0 Pin
Dave Kreskowiak7-Oct-04 5:40
mveDave Kreskowiak7-Oct-04 5:40 
GeneralRe: add text file to sql database, VB6.0 Pin
Mohammad Daba'an8-Oct-04 6:34
Mohammad Daba'an8-Oct-04 6:34 
GeneralRe: add text file to sql database, VB6.0 Pin
Dave Kreskowiak8-Oct-04 7:18
mveDave Kreskowiak8-Oct-04 7:18 
GeneralRe: add text file to sql database, VB6.0 Pin
Mohammad Daba'an8-Oct-04 22:09
Mohammad Daba'an8-Oct-04 22:09 
GeneralRe: add text file to sql database, VB6.0 Pin
Dave Kreskowiak11-Oct-04 4:23
mveDave Kreskowiak11-Oct-04 4:23 
GeneralBad GAC! Bad! ...or... COM Object Problem with VB.Net Pin
Mike the Red6-Oct-04 6:38
Mike the Red6-Oct-04 6:38 
GeneralRe: Bad GAC! Bad! ...or... COM Object Problem with VB.Net Pin
Steven Campbell6-Oct-04 11:59
Steven Campbell6-Oct-04 11:59 
GeneralRe: Bad GAC! Bad! ...or... COM Object Problem with VB.Net Pin
Mike the Red7-Oct-04 7:58
Mike the Red7-Oct-04 7:58 
GeneralVB6 and API calls Pin
aslm6-Oct-04 3:50
aslm6-Oct-04 3:50 
GeneralRe: VB6 and API calls Pin
Anonymous6-Oct-04 12:24
Anonymous6-Oct-04 12:24 
GeneralProblem in "LookupAccountName" function Pin
zeemalik6-Oct-04 0:33
zeemalik6-Oct-04 0:33 
QuestionWH_CBT Global hook? Pin
Hadi Fakhreddine5-Oct-04 20:26
Hadi Fakhreddine5-Oct-04 20:26 
AnswerRe: WH_CBT Global hook? Pin
Anonymous6-Oct-04 11:03
Anonymous6-Oct-04 11:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.