Results 1 to 8 of 8
  1. #1
    Join Date
    Jul 2007
    Posts
    3

    Question Unanswered: Invalid Object Name

    Hi,
    My application uses VB6 and Sql-Server 2000.
    I cant understand why the error
    INVALID OBJECT NAME Run-time error '-2147217865 (80040e37)'
    appears only sometimes and not always. For example, a select instruction is executed inside a loop without any problem 1 thousand times, then when I try to execute it 1 thousand times and one, it fails.


    Have you got any suggestions?

    Ive read a lot of posts on Internet Forums, without finding any solutions.

    In the mail I attach, you can see that the application stops at 79%, after having executed many times the select instruction without any problem!


    Thank you very much for your help!

    Bye,

    Emanuela

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    What attachment?

    Just post the code here...but my guess is you're building dynamic sql
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  3. #3
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Without seeing it I too am guessing dynamic SQL, but I reckon the problem lies in the length/size of a variable you've declared. Varchar(50) for example
    George
    Home | Blog

  4. #4
    Join Date
    Jul 2007
    Posts
    3
    Here is the code:

    Dim Con As ADODB.Connection

    Set Con = New ADODB.Connection
    Con.ConnectionString = "driver={SQL Server};server=OIVN303;uid=NIS_adm;pwd=nisdb04;dat abase=ZET"
    Con.ConnectionTimeout = 3000
    Con.Open

    Set CreaConnessioneDB = Con


    Dim Rs3 As ADODB.Recordset

    Set Rs3 = New ADODB.Recordset
    Rs3.CursorType = adOpenKeyset
    Rs3.LockType = adLockOptimistic
    Rs3.ActiveConnection = Con



    Sql3 = "SELECT * T_NUM_E1_OMC_PER_OFFICE
    Rs3.Open Sql3
    If Not Rs3.EOF Then
    Num_Tot_TRX = Rs3(0)
    Num_Min_E1_GSM = Rs3(1)
    End If
    Rs3.Close

    Set rs3 = nothing

    ...

    Sorry, no attachment.

    Thanks very much to everybody can help me!,
    Bye,
    Emanuela

  5. #5
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Code:
    Sql3 = "SELECT * T_NUM_E1_OMC_PER_OFFICE
    SURELY this is wrong.
    No FROM and no closing quote (")?!
    George
    Home | Blog

  6. #6
    Join Date
    Jul 2007
    Posts
    3
    Ok, I made a mistake during copy and paste:
    Obviously the correct statement is:
    Sql3 = "SELECT * FROM T_NUM_E1_OMC_PER_OFFICE"

    A part from this, can you help me?

  7. #7
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    That's it?

    No Predicates?

    Why not use Stored Procedures in any case?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  8. #8
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Quote Originally Posted by emanuela
    CreaConnessioneDB
    Another typo?

    Fancy pasting this loop you speak of that's causing the problem?
    George
    Home | Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •