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





Reply With Quote