StihlRunning
Programmer
In desperate need of help with Excel VBA ADO access to Oracle tables. I have to deliver this Excel sheet to multiple people and I want the Excel file to be populated with the most recent data from a Oracle DB every time they open it. I don't want them to have to configure a DSN or TSN and it will get passed around and forwarded, etc. I do have a background in Oracle databases and Oracle Applications ERP. I have written VBA code in the past but only with ODBC. I am wanting to deliver spreadsheets that my co-workers can only worry about opening the spreadsheet and everything else is auto for them. So, my dilemma is in my actual call to the database server.
My call:
conn.ConnectionString = "Driver={Microsoft ODBC for Oracle}; " & _
"CONNECTSTRING=(DESCRIPTION=" & _
"(ADDRESS=(PROTOCOL=TCP)" & _
"(HOST=" & strHost & ")(PORT=1521))" & _
"(CONNECT_DATA=(SERVICE_NAME=" & strDatabase & "))); uid=" & strUser & " ;pwd=" & strPassword & ";"
The con.open gives me this error message:
Run-time error '-2147467259(80004005)';
[Microsoft][ODBC Driver Manager]Data source name not found and no default driver specified
I found this code but realize it is for EZ Connect(I have no idea what EZ Connect is) but it looks like what I am looking for:
'OracleConnectionStringBuilder sb = new OracleConnectionStringBuilder();
'sb.DataSource = "MyOracle.MyCompany.com:1521/MySid"; // EZ Connect -- no TNS Names!
'sb.UserID = "xxxx";
'sb.Password = "xxxxxxxx";
'
'OracleConnection conn = new OracleConnection(sb.ToString());
'conn.Open();
I am running on a 64-it operating system and believe my problem is with my drivers. The Microsoft ODBC driver is found in my 32-bit ODBC manager but not my 64-bit ODBC manager. How do I get the Microsoft ODBC into my 64-bit manager? But isn't the whole purpose is to not have to install drivers on machines. Our users do not have any oracle clients or drivers installed on their machines. Currently they have everything(data) pushed to them but I would rather let them get the data when they want it in real-time.
I apologize for the extra-long post but I have been at this all week and have exhausted all my resources. I can't be the only smuck trying to accomplish this simple task!!! HELP is greatly appreciated. And OH, I have until Monday to deliver! ! !
My call:
conn.ConnectionString = "Driver={Microsoft ODBC for Oracle}; " & _
"CONNECTSTRING=(DESCRIPTION=" & _
"(ADDRESS=(PROTOCOL=TCP)" & _
"(HOST=" & strHost & ")(PORT=1521))" & _
"(CONNECT_DATA=(SERVICE_NAME=" & strDatabase & "))); uid=" & strUser & " ;pwd=" & strPassword & ";"
The con.open gives me this error message:
Run-time error '-2147467259(80004005)';
[Microsoft][ODBC Driver Manager]Data source name not found and no default driver specified
I found this code but realize it is for EZ Connect(I have no idea what EZ Connect is) but it looks like what I am looking for:
'OracleConnectionStringBuilder sb = new OracleConnectionStringBuilder();
'sb.DataSource = "MyOracle.MyCompany.com:1521/MySid"; // EZ Connect -- no TNS Names!
'sb.UserID = "xxxx";
'sb.Password = "xxxxxxxx";
'
'OracleConnection conn = new OracleConnection(sb.ToString());
'conn.Open();
I am running on a 64-it operating system and believe my problem is with my drivers. The Microsoft ODBC driver is found in my 32-bit ODBC manager but not my 64-bit ODBC manager. How do I get the Microsoft ODBC into my 64-bit manager? But isn't the whole purpose is to not have to install drivers on machines. Our users do not have any oracle clients or drivers installed on their machines. Currently they have everything(data) pushed to them but I would rather let them get the data when they want it in real-time.
I apologize for the extra-long post but I have been at this all week and have exhausted all my resources. I can't be the only smuck trying to accomplish this simple task!!! HELP is greatly appreciated. And OH, I have until Monday to deliver! ! !