Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

oracle connection failed ...pl help

Posted on 2001-07-24
2
Medium Priority
?
172 Views
Last Modified: 2010-05-02
hi
look at set iRS code ....Pl help i am new to VB...
Pl





Private Sub txt_ItemNo_Change()
Dim rRs As Recordset, strSQL As String, g_Pr_Item_No As String, i As Byte
On Error GoTo txt_ItemNo_Change_Error
     If bool_ItemNo = True Then
          For i = 0 To 6: txt_Product(i) = "": Next: bool_ItemNo = False: Exit Sub
     End If

   g_Pr_Item_No = Trim(UCase(txt_ItemNo.Text)): lst_ItemNo.Visible = False
   If Len(g_Pr_Item_No) > 3 Then
       strSQL = "Select  ITEM_NO  From  IC_ITEM_MST " & _
       " Where ITEM_NO Like '" & g_Pr_Item_No & "%' GROUP BY ITEM_NO "
        Set iRs = dbS.OpenRecordset(strSQL, dbOpenSnapshot, dbSQLPassThrough): lst_ItemNo.Clear
          If g_Pr_Item_No <> "" Then
             
              Do While Not iRs.EOF
                  lst_ItemNo.AddItem iRs.Fields(0): iRs.MoveNext
              Loop
              If lst_ItemNo.ListCount > 0 Then lst_ItemNo.Visible = True: bool_ItemNo = False
           End If
   End If: Exit Sub
txt_ItemNo_Change_Error:
CreateErrorLogFile " txt_ItemNo_Change ", g_str_LogErrorFile, Err.Number, Err.Description
End Sub
0
Comment
Question by:ram9999
  • 2
2 Comments
 
LVL 8

Expert Comment

by:Dave_Greene
ID: 6314533
Make you connection first

 ODBC Driver for Oracle

For the current Oracle ODBC Driver from Microsoft:

oConn.Open "Driver={Microsoft ODBC for Oracle};" & _
                   "Server=OracleServer.world;" & _
                   "Uid=myUsername;" & _
                   "Pwd=myPassword;"

For the older Oracle ODBC Driver from Microsoft:

oConn.Open "Driver={Microsoft ODBC Driver for Oracle};" & _
                   "ConnectString=OracleServer.world;" & _
                   "Uid=myUsername;" & _
                   "Pwd=myPassword;"


Or Build a DSN and connect
0
 
LVL 8

Accepted Solution

by:
Dave_Greene earned 150 total points
ID: 6314590
Assuming you have a connection...

strQry = "Select  ITEM_NO  From  IC_ITEM_MST " & _
      " Where ITEM_NO Like '" & g_Pr_Item_No & "%' GROUP BY ITEM_NO "

  Set ADORS = New ADODB.Recordset
 
  ADORS.Open strQry, ADO_CONN, adOpenStatic, adLockBatchOptimistic
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question