Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADOConnection + ConnectString

Status
Not open for further replies.

Karen99

Programmer
Aug 5, 2003
113
0
0
ZA
Hi

I'm new to ADO. So please be patient ! :)

I am using Delphi 7 and Oracle 8.1.6.

I used BDE TDatabase and connect during runtime. I get the username and password and dbname from the registry, and use that to connect.

Now I also want to connect with ADO during runtime. Wel, I am doing it, my connectstring looks like this :

Provider=MSDAORA.1;Password=grmssys;User ID=grmssys;Data Source=grms.world;Persist Security Info=True

And it word fine. Problem is that it does not work on another pc. I am using Windows 2000 and the other pc is using XP. Coult that make a difference or must I look at something else ?

My code :

GRMSConnection.ConnectionString := ADODBInfo;

DatabaseMain.Params.Assign(ParamList);
try
SessionMain.Open;
DatabaseMain.Open;
GRMSConnection.open;
Result := True;
except
end;

GRMSConnection is the adoconnection;
DatabaseMain is the bde connection;
ADODBInfo is the connectstring.

Regards
Karen


 
2 questions :

- what error are you having. (the exact description)
- does the datasource "grms.world" exist on the xp pc??

--------------------------------------
What You See Is What You Get
 
Don't have the error with me, but it comes down to that it can not connect to oracle.

Yes the grms.world exist on the xp pc. The TDatabase connect just fine and it is also using grms.world.

Can the type of provider change from pc to pc ?
 
Hi.
I haven't connected to a Oracle database before, but with all other connections, the Datasource parameter has to be added on the local Oracle installation.

Provider=MSDAORA.1;Password=grmssys;User ID=grmssys;Data Source=grms.world;Persist Security Info=True

With Sybase, you have to add connection information in the Sybase OleDb Installation. What you have to do with Oracle I don't know.... But it should be similar to Sybase.

Sybase stores the connection info in a Datasource directory in files named ???.ids and the files look like this
(This file is called MYCONNECTION.IDS):

Code:
[Provider]
ProviderName=Sybase ASE OLE DB Provider
ClsID={DDACBAD3-9F47-7379-96DA-00105A17E92A}
[Properties]
Initial Catalog=
Connect Timeout=9999
Server Name=server.somewhere.com
Network Protocol=Winsock
Server Port Address=5000
Character Set=iso_1
Application Name=My AppName
Optimize Prepare=Partial
Select Method=Direct
Raise Error Behavior=MS Compatible
Print Statement Behavior=MS Compatible
Extended ErrorInfo=FALSE
Stored Proc Row Count=Last Statement Only
WorkStation ID=MyStation
Row Cache Size=50
Enable Quoted Identifiers=0
Packet Size=1
Default Length For Long Data=5120
Tightly Coupled Distributed Transactions=0

The ADO connection info should look like this when connecting to Sybase:

Code:
Provider=Sybase.ASEOLEDBProvider.2;Initial Catalog=master;User ID=TheUser;Password=ThePassword;Data Source=[b]MYCONNECTION[/b];Persist Security Info=True
...Hope this helps a little bit...

//Nordlund
 
Check the tnsnames.ora file. It may be missing grms.world and therefore won't know where to find it!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top