Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

VB6 ado .update Method Error "Could Not Find Server Expand / Collapse
Author
Message
Posted Wednesday, July 29, 2009 6:41 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, July 29, 2009 2:04 PM
Points: 1, Visits: 8
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


Post #761470
Posted Thursday, October 29, 2009 11:07 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, May 20, 2010 2:32 PM
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
Post #811017
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse