Results 1 to 8 of 8

Thread: Connecting to Oracle using ado....

  1. #1

    Thread Starter
    Banned
    Join Date
    Jul 2000
    Posts
    11
    Hi,
    I cannot make a connection to oracle database from VB6 using ado.
    First i tried to make a dsn connection. The code that i have is:

    Dim cn As ADODB.Connection
    Dim strConnection As String
    Dim adStatus As ADODB.EventStatusEnum
    Set cn = New ADODB.Connection

    strConnection = "DSN=atdb;UID=atedb;PWD=atdb;"
    cn.Open strConnection
    If adStatus = adStatusOK Then
    MsgBox "Connected ok"
    Else
    MsgBox "Connection not made"
    End If

    Then i tried making a dsn-less connection.The code that i tried is :

    strConnection = "Server=dwtest.world;driver={Microsoft ODBC for Oracle};UID=atdb;PWD=atdb;"
    cn.Open strConnection

    But it did'nt work either!I tried connecting through the
    Visual Data Manager and the Data Environment. But it did not work. I know that the user_id, the password and the server name are right as i can log in through SQLPlus.
    Am i missing out something? Please help..

  2. #2
    Junior Member
    Join Date
    Dec 1999
    Location
    westmids
    Posts
    18
    right !

    1.forget creating a dsn its crap with oracle(so is oracle)
    2.is net8 sopport setup right you should be able test the connection with the net8 easy config stuff
    3.if it fails check to see if you have external os privliges setup right or it your using password authentaction make sure thats set up right.(you should log into windows with the same username and password as the database your trying to connect to!)
    4.check your gratened roles!
    5.use the oledb provider when you set up the connection its a bit slower than odbc but give better sopport to the oracle(pants) database or use the oracle(pants) 0040 provider its has full sopport and its quicker than oledb.(cus your calling directly to the oracle(pants) oci(oracle call interface)) but you will need to lean the new way of using the 0040 stuff)...

    it should all work all you have to do then is get oracle to do productive stuff with billions of lines if code(as you might of guessed im not a fan im working with it at the mo #i think its pants)

    hope this is help full

  3. #3

    Thread Starter
    Banned
    Join Date
    Jul 2000
    Posts
    11
    Hi nexus,
    I tested the connection with the net8 easy config. It connects fine.I cannot make it connect from within my VB application. Do you have an idea about what might be causing the problem.

  4. #4
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    try this connection string:

    "Provider=MSDAORA;Data Source=ServerName;User Id=User;Password=Pass;"

  5. #5
    Junior Member
    Join Date
    Dec 1999
    Location
    westmids
    Posts
    18
    ok!

    if the net8 did work then

    create the connection with the oledb provider(use the data enviroment or adocontrol for now to test it for convinience)

    if your using os authentacation then type the name of the connection you user when you created the database in the net8 config and press test connection it should work.
    if you get user name or pw error then try it with the system manager username pw and try again.
    or try with the uname and pw u tryed in the net8 config!

    if it still donsnt work now then!
    1.your using the incorrect name for the data base (ie
    your using the servername or sid name instead of the user createabe name that the user creates easly id the db)
    2.pass word errors, if the database has just been set up then you should be able to log in as user = system pw = manger

    it might be a good idea to start from scratch in this case ie
    delete the intace of the db (only in the net8 easy config) and create a new one.note the user name for the db.

    your almost there with it because the net8 can see and log in to your db its just a matter of making sure your using the correct login and db name like i said try setting it up in the data env or the ado control. it will work!

    good luck

  6. #6

    Thread Starter
    Banned
    Join Date
    Jul 2000
    Posts
    11
    I tried connecting using ado control.It connects fine. I used the same connection string that i used before to connect programatically. But somehow when i use the ado object, it does not work. What do you think i should try now...

  7. #7
    Junior Member
    Join Date
    Dec 1999
    Location
    westmids
    Posts
    18
    if your not on virsion mdac 2.5 then it worth a try( it also allows you to return a recordset from a stored proc so best to be on it anyway)

    every thing should have worked\

    so it might be and error with your data accsess components

    so an up grade to 2.5 may fix it!

    there are mdac diognostic tools on http://www.microsoft.com/data

    wich will tell u if theres a problem.

    sorry i carnt be any more help
    carnt really say what the problem is without seeing it for my self.




  8. #8

    Thread Starter
    Banned
    Join Date
    Jul 2000
    Posts
    11
    I reinstalled MDAC 2.5. I can now connect through Visual Data Manager and the data environment. But i still cannot connect through the ado object. Anyway, thanks a lot for your help. I really appreciate it.
    Does anybody else have any suggestions?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width