Sean Lange (3/12/2014)
rahma.andany (3/12/2014)
Hi all ,I have problem with my application, when uploading picture into sql server 2000 my application showing error message ( Run-time error '-2147467259(80004005)' Time out expired ). This error appear after my technical team replace old server with the new server.
FYI
old server running on windows server 2000 and sql server 2000
new server running on windows server 2003 and sql server 2000
In my case, this error appear only on office hour and my picture size above 20 kb , but when i trying after office hour and my picture size under 20 kb.. the error messages is not appear.
Anyone know how to solve my problem? 🙂
Hi and welcome to the forums. You didn't provide anywhere near enough details to offer anything resembling help here. The only thing we know is that your connection timed out. We don't know anything else. Sounds like maybe you have blocking on your sql server but it is hard to know for sure.
Thanks for your response, i'm sorry if my information is not complete
My application develop under vb 6 and here's my code to put picture in sql server 2000
Dim cn As ADODB.Connection
Dim RsFile, RsX As ADODB.Recordset
Public FileID As String
Dim FNum As Integer
Private Sub Cmdexit_Click()
Unload Me
End Sub
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub
Private Sub File1_Click()
TxFileName.Text = File1.FileName
cmdImportADO.Enabled = True
End Sub
Private Sub Form_Load()
Dim StrCn As String
Dim a As String
Set RsX = New ADODB.Recordset
Set RsFile = New ADODB.Recordset
TxFileName.Text = ""
cmdImportADO.Enabled = False
End Sub
Private Sub CmdImportADO_Click()
Dim fPath, fNama, fType As String
Dim StrQ As String
Dim xN As Byte
Dim TmpData() As Byte
Dim FSize As Long
Dim RsX As ADODB.Recordset
Load frmUpdPic
a = frmUpdPic.dbcass.Value
If File1.ListIndex >= 0 Then
cmdImportADO.Enabled = False
fNama = File1.FileName
fPath = File1.Path
If Right(fPath, 1) <> "\" Then
fPath = fPath & "\"
End If
StrQ = "select COUNT(*) as N from fixasset_mtr Where picture1 ='" & File1.FileName & "'"
Set RsX = New ADODB.Recordset
RsX.Open StrQ, cnFin, adOpenKeyset, adLockOptimistic
xN = RsX!n
RsX.Close
'If xN = 0 Then
StrQ = fPath & fNama
Open StrQ For Binary As #1
ReDim TmpData(LOF(1))
Get #1, , TmpData
Close #1
StrQ = "select * from fixasset_mtr where Asset_no = '" + a + "'"
'" & FileID & "'"
Set RsX = New ADODB.Recordset
RsX.Open StrQ, cnFin, adOpenKeyset, adLockOptimistic
If Not RsX.EOF Then
RsX("picture1").Value = File1.FileName
RsX("Picture").AppendChunk (TmpData)
RsX.Update
RsX.Close
End If
End If
cmdExit.Enabled = True
End Sub
When i try to upload picture, sometime appear error in RsX.Update
it sound like my code getting wrong, but this error not always appear.
The error messages will appear when picture size above 20 kb and uploading picture on working time.
Any idea?