Oracle DataBase

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Oracle DataBase

    Hello All,

    We are trying to use Oracle to collect measurement data and we are having trouble connecting to Oracle with Visual Basic Script. We get an error "invalid username and password". We think the syntax may not be totally correct - See below:

    Sub Main()
    Dim Cn As Object
    Dim Conn As String
    Dim QSQL As String
    Dim rs As Object
    Dim EMPNO As String
    Dim EmpName As String
    Dim EmpJob As String

    EMPNO = "8110"
    EmpName = "Smith"
    EmpJob = "QA"

    Set Cn = CreateObject("ADODB.Connection")
    Cn.Open "Provider=OraOLEDB.Oracle;""Data Source=STHDEV.NET.SMITH.COM;""User Id=scott;""Password=tiger;"

    Set rs=CreateObject("ADODB.RECORDSET")
    rs.ActiveConnection = Conn
    rs.CursorLocation = 3
    rs.CursorType = 3
    rs.LockType = 3

    QSQL = "Insert Into EMP (EMPNO, ENAME, JOB) Values ('" & EMPNO & "','" & EmpName & "','" & EmpJob & "')"

    rs.Open QSQL

    'MsgBox "Done"


    End Sub

    Has anyone ever done this before or does anyone have any suggestions?

    Thanks,
    Jim

  • #2
    I have done Database only once and it was text book. Check these guys out. They have a DB room and a VBA room. There are a lot of very smart folks there. Should your separator be in quotes as it is when you pass the user name and password in the CN.Open method?

    Craig
    <internet bumper sticker goes here>

    Comment

    Related Topics

    Collapse

    Working...
    X