Login | |
|
 |
RE: About connecting to Oracle - 9/8/2005 7:36:11 PM
|
|
 |
|
| |
Zifter
Posts: 318
Score: 0
Joined: 1/5/2005
From: Belgium
Status: offline
|
The DIM xxx AS xxx statements don't work in VbScript. All the variables in VbScript are of the type Variant. You can't specify wich type of variable you're declaring. I think it should be something like this: Dim AdConnection Dim rsadSet Set AdConnection = CreateObject("ADODB.Connection") Set rsadSet = CreateObject("ADODB.Recordset") ... HTH
|
|
| |
|
|
|
 |
RE: About connecting to Oracle - 9/8/2005 8:21:58 PM
|
|
 |
|
| |
Zifter
Posts: 318
Score: 0
Joined: 1/5/2005
From: Belgium
Status: offline
|
I can't see any problem in your code. Syntactic it is correct. Are you sure the variables AdConnString and strSQL contain correct values? Do you get an error?
|
|
| |
|
|
|
 |
RE: About connecting to Oracle - 9/8/2005 10:02:10 PM
|
|
 |
|
| |
Zifter
Posts: 318
Score: 0
Joined: 1/5/2005
From: Belgium
Status: offline
|
Although I'm not familiar with Oracle, looking at your code and the error description, I think your variable DBProvider is not filled in (I can't see where you fill in the pswd and usrid variables either, but I assume you left them out for security reasons). Does it work if you add the following statement at the beginning of your script? DBProvider = "MSDAORA"
|
|
| |
|
|
|
 |
RE: About connecting to Oracle - 9/11/2005 8:36:05 PM
|
|
 |
|
| |
Zifter
Posts: 318
Score: 0
Joined: 1/5/2005
From: Belgium
Status: offline
|
An Excel file? I don't understand what an Excel files has got anything to do with your problem? ... Or are you writing a VBA program instead of VbScript? Anyhow, I don't think it will be of any use to send it to me. I don't know much about Oracle and I don't have it, so I won't be able to test it anyway. Maybe you can post your script here on the forum and everybody can have a look if they see anything that needs to be changed. <edit> I have a script that I use to connect to a MS SQL DB. I changed the connection string and query according to your specifications. Can you test this script and post your findings? Option Explicit Dim objADOConnection Dim objADORecordSet Dim strSQLCommand Set objADOConnection = CreateObject("ADODB.Connection") Set objADORecordSet = CreateObject("ADODB.Recordset") strSQLCommand = "Select customer,customer_name " & _ "from customer_table " & _ "where rownum<=10" objADOConnection.Open "Provider='MSDAORA';" & _ "Initial Catalog='iqtest2';" & _ "Data Source='vsiqship.fe.corp.zim.com';" & _ "User ID='xxxx';" & _ "Password='xxxx';" objADORecordSet.Open strSQLCommand,objADOConnection,adOpenStatic Do Until objADORecordSet.EOF WScript.Echo objADORecordSet.Fields("customer_name") objADORecordSet.MoveNext Loop objADORecordSet.Close objADOConnection.Close Set objADORecordSet = Nothing Set objADOConnection = Nothing
< Message edited by Zifter -- 9/11/2005 8:57:54 PM >
|
|
| |
|
|
|
 |
RE: About connecting to Oracle - 9/12/2005 6:23:24 PM
|
|
 |
|
| |
Zifter
Posts: 318
Score: 0
Joined: 1/5/2005
From: Belgium
Status: offline
|
I got the same error, but I don't have Oracle. So probably there is something wrong with your DB name (Data source) Can you try the following: Remove the Initial Catalog parameter and change the Data Source parameter into "vsiqship.fe.corp.zim.com\iqtest2" objADOConnection.Open "Provider='MSDAORA';" & _ "Data Source='vsiqship.fe.corp.zim.com\iqtest2';" & _ "User ID='" & usrid & "';" & _ "Password='" & pswd & "';" HTH
|
|
| |
|
|
|
 |
RE: About connecting to Oracle - 11/17/2005 7:12:28 PM
|
|
 |
|
| |
TNO
Posts: 1302
Score: 12
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
|
Oracle has been a nightmare for me as well. I've gotten most of my help on the subject from here: http://www.webdeveloper.com/ The people there are alot more knowledgeable on the Oracle subject.
_____________________________
To iterate is human, to recurse divine. -- L. Peter Deutsch
|
|
| |
|
|
|
|
|