Ole DB Connection string
Teradata Teradata Discussion Forums Teradata.com Discussion Forum
Visit Teradata.com
Home       Guidelines    Member List
Welcome Guest ( Login | Register )
        


This online forum is for user-to-user discussions of Teradata products, and is not an official customer support channel for Teradata. If you require direct assistance, please contact Teradata support.


Ole DB Connection string Expand / Collapse
Author
Message
Posted 1/10/2006 10:38:06 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 4/24/2006 1:57:00 PM
Posts: 3, Visits: 1
We are (attempting) to use the Ole Db provider for .NET. I am able to connect to the database, but cannot figure out the correct way to set the default database. What is the connection string property for setting the Default Database?
Post #3334
Posted 1/10/2006 11:55:13 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 4/24/2006 1:57:00 PM
Posts: 3, Visits: 1
It looks like I found the answer - using the Extended properties appears to do the trick. Here is an example of the connection string that seems to work:

Provider=TDOLEDB.1;Data Source=xxx.xxx.xxx;Persist Security Info=True;User ID=user;Password=12345;Extended Properties=Default Database=DataBaseName;Session Mode=ANSI

Now, a new problem/question: when adding parameters to a command, what prefix (if any) should be used before the parameter name? If I remember correctly, ODBC likes a ":", Sql server uses a "@". Have any ideas on how to properly prefix a named parameter using the OLE DB Provider?

thanks in advance,

Sancerre
Post #3335
Posted 1/11/2006 10:47:11 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 4/24/2006 1:57:00 PM
Posts: 3, Visits: 1
We have found the answer to the last question as well. To help any of you that may need to use parameters with a command object, then this is how we got it to work: Don't use named parameters, instead use a "?" as the name for each parameter. Of course, you had better make sure that your params are added and used in the correct order.

If anybody out there has managed to use named parameters with OLE DB, then please let us know the trick!

-- Sancerre
Post #3340
« Prev Topic | Next Topic »


Reading This Topic Expand / Collapse
Active Users: 0 ( 0 guests, 0 members, 0 anonymous members )
No members currently viewing this topic.


All times are GMT -5:00, Time now is 7:02pm

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.063. 10 queries. Compression Disabled.