SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


VB6 ado .update Method Error "Could Not Find Server


VB6 ado .update Method Error "Could Not Find Server

Author
Message
mike.rapko
mike.rapko
Grasshopper
Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)Grasshopper (17 reputation)

Group: General Forum Members
Points: 17 Visits: 10
VB6 Code using a recordset's .Update method connected to an SQL Server 2005 database via a DSN (Sql Server or Native Client type) returns the following error:
[Microsoft] [ODBC SQL Server Driver] [SQL Server] Could not find the server 'servername' in sys.servers. Verify that the correct server name was specified. If necessary, execute the stored procedure sp_addlinked server to add the server to sys.servers.

This error is occurring on just one specific site. Other saves at this site which save by executing update queries work okay. Here is the VB6 code that creates the error:
With rsImage
.CursorType = adOpenDynamic
.CursorLocation = adUseServer '2009.07.23 added for KD2.exe
.LockType = adLockPessimistic
.Source = strQ
.ActiveConnection = gAdoCon
.Open
MsgBox "Line 294, after open rsImage"
End With
If Not rsImage.EOF Then
rsImage.MoveFirst
Open mstrImageName For Binary Access Read As #1
MsgBox "Line 300, after open " & mstrImageName
lngFileLen = LOF(1) ' Length of data in file
rsImage!RP_ImageObject.AppendChunk Null
ReDim Chunk(lngFileLen)
Get (1), , Chunk()
rsImage!RP_ImageObject.AppendChunk Chunk()
MsgBox "Line 306, after Append Chunk"
Close #1
MsgBox "Line 308, after Close #1"

Erase Chunk

rsImage!RP_ImageFile = mstrImageName
rsImage!RP_ImageFlag = ImageObjectFlag

'The elow line generates the error
rsImage.Update
MsgBox "Line 315, after rsImage.Update"
rsImage.Close
Set rsImage = Nothing
End If 'Not rs.Image2.EOF
saishanthan
saishanthan
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: General Forum Members
Points: 1 Visits: 18
Hi Mike,

Were you able to find the solution? Then Could you please post your solution here. Thank you.

Regards,
SS
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search