Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Moving an app from MSSQL to Oracle

Re: Moving an app from MSSQL to Oracle

From: Pete's <empete2000_at_yahoo.com>
Date: 23 Oct 2001 06:27:40 -0700
Message-ID: <6724a51f.0110230527.5a9072c7@posting.google.com>


Try something like the following:

Public WithEvents cn As ADODB.Connection public LoginSucceeded as boolean

Private Sub ConnectToDB()
  dim strConnection as string

  On Error GoTo ErrHandlerLogin   

  Set cn = New ADODB.Connection
  With cn

    .ConnectionTimeout = 20
    .CursorLocation = adUseClient
    .Provider = "MSDAORA"

  End With
  strConnection = "SERVER=TNS:MYDB.WORLD; Data Source=MYDB; Database=MYDB; ; User Id=" & Trim(txtUserName.Text) & "; Password=" & Trim(txtPassword.Text) & ";"
  cn.Open strConnection
  LoginSucceeded = True   

  Exit Sub
ErrHandlerLogin:
  MsgBox Error, vbOKOnly
  LoginSucceeded = False
end sub

HTH,
Pete's

"Dan McLoughlin" <infoserve_at_indigo.ie> wrote in message news:<P29B7.2020$8s4.7457_at_news.indigo.ie>...
> Hi all,
>
> I am trying to connect to an Oracle database with a VB application that
> curreently uses a SQL database. I set up the connection for SQL as follows:
>
> Public conMain As Connection
> .
> .
> Set conMain = New Connection
> .
> .
> ' get database settings from registry
> strDatabasePath = GetSetting("MyDB", "ConnectionDetails", "DatabasePath")
> strDatabaseUser = GetSetting("MyDB", "ConnectionDetails", "DatabaseUser")
> strDatabasePassword = GetSetting("MyDB", "ConnectionDetails",
> "DatabasePassword")
> strDatabase = GetSetting("MyDB", "ConnectionDetails", "Database")
> .
> .
> 'set the connection properties
> conMain.Properties("Data Source") = strDatabasePath ' machine name
> conMain.Properties("User ID") = strDatabaseUser ' user name
> conMain.Properties("Password") = strDatabasePassword ' password
> 'connect to SQL
> conMain.Open
> 'specify db to use
> conMain.DefaultDatabase = g_Database '
>
> Can anyone please tell me what is the equivalent connection string for an
> Oracle 8i database, plus any other problems to expect after I make the
> connection. Any help would be much appreciated.
>
> BTW, re the previous discussion on Oracle vs MSSQL, I don't know anything
> about Oracle, but after downloading it from the web I had it installed and
> my SQL database migrated in a few hours without any problems.
>
> Dan.
Received on Tue Oct 23 2001 - 08:27:40 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US