Solved

oracle connection failed ...pl help

Posted on 2001-07-24
2
160 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 50 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

757 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now