Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21965

file path save in database field

$
0
0
below is my form code and i save image in my image fiolder but how can i save path in photofield

Private Sub Command2_Click()
Dim user As String
Dim email As String
Dim reg1 As String
Dim reg2 As String
Dim reg3 As String
Dim regcode As String
Dim result As Long
sPhotoPath = App.Path & "\idimage\"

iMaxCount = GetMaxNumber ' call the GetMaxCount function


user = "myvb6l"
email = "123@yahoo.com"
reg1 = "682B02601BCFE36BE89DBA4C6F25FEC5BA53C1DFA1A49DE434C1E636C64318C57D7908ABDF7CD740373"
reg2 = "A4C56E94F6BC9BAC0F08B550BFF8E586FA4EDF62B9A6DA9674FC80786E14D903212E31A63148684"
reg3 = "D4148D62EB1CAA52CA25C1705E5A29ACBC3690F32C79228723804562D82E17D67E74A84922D18EE45D6A1D83204E31032E4 15D458BB3D888F2F1D4A451C6D68DABA1D67D"
regcode = (reg1 & reg2 & reg3)

result = vstwain1.Register(user, email, regcode)
vstwain1.StartDevice
If vstwain1.sourceIndex = 1 Then
vstwain1.showUI = False
vstwain1.disableAfterAcquire = False
vstwain1.Acquire
End If


End Sub


Private Sub vstwain1_PostScan(ByVal Flag As Long)
vstwain1.jobControl = 1
If Flag <> 0 Then
If vstwain1.errorCode <> 0 Then
MsgBox vstwain1.errorString
End If
Else
Set Image1.Picture = vstwain1.GetCurrentImage
If vstwain1.SaveImage(0, sPhotoPath + "photo" + Str(iMaxCount + 1) & ".jpg") = 0 Then
MsgBox vstwain1.errorString
End If
End If
End Sub


Public Function GetMaxNumber() As Integer

Dim sPhotoPath As String
Dim sPhotoFile As String
Dim iFileCount As Integer

' set folder path
sPhotoPath = App.Path & "\idimage"

' start searching for the total file count
sPhotoFile = Dir(sPhotoPath & "\*.jpg")
Do While sPhotoFile <> "" ' loop until DIR() can't find anymore files
iFileCount = iFileCount + 1 ' increment the counter
sPhotoFile = Dir ' call DIR() until we search the whole folder
Loop

GetMaxNumber = iFileCount

End Function

Viewing all articles
Browse latest Browse all 21965

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>