VB6 ado .update Method Error "Could Not Find Server

  • 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

  • Hi Mike,

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

    Regards,

    SS

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply