Solved

oracle connection failed ...pl help

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

777 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