Results 1 to 7 of 7

Thread: E_Fail Status Error

  1. #1

    Thread Starter
    Hyperactive Member kxcntry99's Avatar
    Join Date
    Jun 2006
    Location
    Pennsylvania
    Posts
    342

    E_Fail Status Error

    Can anyone help me out with an e_Fail status error I am getting. I have been banging my head against the wall all afternoon as to why I am getting this. It should be pretty simple. The user should enter a record id into txtBid and then when a command button is clicked a new recordset should be created and filled with the record from the text box.

    Code:
    Private Sub Command1_Click()
    Dim rsmultiplebids As ADODB.Recordset
    Set rsmultiplebids = New ADODB.Recordset
    rsmultiplebids.CursorLocation = adUseClient
    Dim sqlGetBidData As String
    
    If Not txtBid.Text = "" Then
        Call corelink
        
        sqlGetBidData = "Select * from core_dedup where BID = '" & txtBid.Text & "'"
        MsgBox sqlGetBidData
        rsmultiplebids.Open sqlGetBidData, cnCore, adOpenDynamic, adLockPessimistic, adCmdText
        
        cmdSplit.Enabled = True
        rsmultiplebids.MoveFirst
        Set DataGrid1.DataSource = rsmultiplebids
        DataGrid1.Refresh
    Else
        MsgBox "Please enter a BID to review", vbInformation, "Error"
    End If
        
    End Sub
    Public Sub corelink()
    Set cnCore = New ADODB.Connection
    cnCore.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=xxxx;PORT=3306;DATABASE=core; USER=SCA_Terminal;PASSWORD=kevin;OPTION=3;"
    cnCore.Open
    
    End Sub
    Last edited by kxcntry99; Jul 17th, 2008 at 10:22 AM.
    Microsoft Office Integration:Useful Database Links:
    Connection Strings


    Im a pogramar
    Iam a programer
    I’m a programor

    I write code!

  2. #2
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,513

    Re: E_Fail Status Error

    I tested your code with my connection string and it worked. What line of code is causing the error?

  3. #3

    Thread Starter
    Hyperactive Member kxcntry99's Avatar
    Join Date
    Jun 2006
    Location
    Pennsylvania
    Posts
    342

    Re: E_Fail Status Error

    I have a line

    Code:
    rsmultiplebids.movefirst
    In another sub that causes the error. It looks to me like the recordset isn't being filled even though I know that the record ID I am putting in the text box has records in the DB associated with it.
    Microsoft Office Integration:Useful Database Links:
    Connection Strings


    Im a pogramar
    Iam a programer
    I’m a programor

    I write code!

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: E_Fail Status Error

    You are creating it at the event level of your button. As such, msmultiplebids does not exist outside of the code in that button click event.

  5. #5

    Thread Starter
    Hyperactive Member kxcntry99's Avatar
    Join Date
    Jun 2006
    Location
    Pennsylvania
    Posts
    342

    Re: E_Fail Status Error

    I've had the Dim statment up in the general section and still got the same error. I only put it under the click event to show that I was DIMing it.
    Microsoft Office Integration:Useful Database Links:
    Connection Strings


    Im a pogramar
    Iam a programer
    I’m a programor

    I write code!

  6. #6
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,513

    Re: E_Fail Status Error

    I would suggest posting the "exact" code, it will make it easier to find the problem.

  7. #7
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,513

    Re: E_Fail Status Error

    Also check the recordset to see if there are records in it.

    Code:
    rs.open .......
    
    if rs.EOF or rs.BOF then
        ' no records
    end if

Posting Permissions

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



Click Here to Expand Forum to Full Width