Showing posts with label odbc. Show all posts
Showing posts with label odbc. Show all posts

Tuesday, March 27, 2012

CREATE TABLE in wrong database (Master)

I am using ASP.NET 1.1 and MS SQL 2005

the folowing ODBC stringconnection
Driver={SQL Server};Server=(local);MyBase;Uid=;Pwd=;Trusted_Co nnection=;

when trying to CREATE a TABLE (with vb.net code) I get an error because the TABLE are written inMaster !! and not inMyBase

I am using windows Authentication

what can be wrong ?

thank youWhat is your reason for creating table in VB.NET instead of managment studio with SQL or the GUI and why are you using obsolete ODBC instead of ADO.NET? When you get the answer to that you will know why you are creating the table in the Master database. Hope this helps.|||Caddre if you donyt know the answer to that problem please give up !
i must do it in that way because the database allready exists in many intranets on > 10 000 PC|||the problem is why is it creating tables in Master when the connection string =
Driver={SQL Server};Server=(local);MyBase;Uid=;Pwd=;Trusted_Connection=;

?

|||But you still don't do it that way, you have two options get the DBA to create the table for you or you should just right click and register the SQL Server with the database at the top of management studio. The number of users on the network is not relevant the only requirement is on the same network and in an intranet you are. And you don't need new SQL Server with your SQL Server running your DBA can give you the personal SQL Server free it comes with the license. Here I have read only access to Oracle if I need to create something the DBA will create it. And yes I also use SQL Server I can help you with most problems. Post again if you still need more help. Hope this helps.|||thanks a lot Caddre but it works fine now

just forgottent database= in the connectionstring when i have copy-pasted the string

and that way of course works perfectly|||I am glad you got it resolved and I am sorry about my first post.

Sunday, March 25, 2012

CREATE TABLE in wrong database (Master)

I am using ASP.NET and a normal ODBC stringconnection

Driver={SQL Server};Server=(local);MyBase;Uid=;Pwd=;Trusted_Co nnection=;

when trying to CREATE a TABLE (with vb.net code) I get an error because the TABLE are written in Master !! and not in MyBase

i am using windows authentication

what can be wrong ?

thank youHi

Your default db will be master. You need to name your params in the string. How about:

Driver={SQL Server};Server=(local);Database=MyBase;Uid=;Pwd=;T rusted_Connection=;
?

EDIT - BTW - do you not need to put True after trusted connection or does that work?|||And...

never need to ask a connection string question of anyone again:
http://www.connectionstrings.com/
http://www.carlprothman.net/Default.aspx?tabid=81

HTH|||my connection string is perfect .. it is not a connectionstring problem|||No it's not. Have another look. MyBase is just floating there. And Trusted Connection, Uid and Pwd are parameters without values.

Check the links.|||my connection string is perfect .. it is not a connectionstring problem

So....

Why are you asking for help then?|||So....

Why are you asking for help then?It's perfect... That doesn't mean that it is working.

-PatP|||You could also set the default for the userid to the database you want the table(s) written to. Then the default would be MyBase instead of Master.

Lookup sp_defaultdb in BOL.|||this connecting string is working fine since 6 months, i have installed MS SQL 2005 on MS SQL 2000 and it doesnt work any more, it is not a connectionString problem
it is a database rights problem, and a microsoft problem too|||You could also set the default for the userid to the database you want the table(s) written to. Then the default would be MyBase instead of Master.

Lookup sp_defaultdb in BOL.

there is no UserId no password I am using windows authentication

what do you mean by Then the default would be MyBase instead of Master.

do you mean the user account ? I am using only one user account for all my databases

thank you|||Hi

Whatever account you use (SQL or NT) to connect to SQL Server will have a default database assigned to it. If you don't specify a database in your connection string you will connect to the default database. You have not specified a database in your connection string (however perfect it may be) so you are connecting to your default database, typically master (master is the default default database :) ). So - either specify a database in your connection string or change your default database in SQL Server.|||it works now !!

thank you|||this connecting string is working fine since 6 months, i have installed MS SQL 2005 on MS SQL 2000 and it doesnt work any more, it is not a connectionString problem
it is a database rights problem, and a microsoft problem tooAh - just realised your problem - I bet in 2000 the default db was set up but not in 2005 eh? Seriously - the MyBase bit in your connection string is doing nothing - I'm surprised it didn't throw an exception to be honest.

Glad to have helped :D|||it works now !!

thank you

Must be the miracle connection string...

And I'm sure you didn't change a thing...

Wednesday, March 21, 2012

create same Database connection on multiple computers

Hi,
is there a possibility to create automaticaly a ODBC database connection on
the multiple client computers (equal for all of them), in ex. on windows
2000 Profesional or XP?
And secont thing. Is there a possibility to automaticaly change all of the
ODBC connections without changing one by one?
Thanks for help.
Marcin
yes it is possible. Just create(or modify) the regkey from
HKEY_LOCAL_MACHINE
SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources\
SOFTWARE\ODBC\ODBC.INI\
You can do very easy a program to do all this change. I've made one, and it
works well
Gabriel Anton
Software Developer
"#'ak" <mkrzyz@.beretta.pl> wrote in message
news:cgfjtn$4v3$1@.atlantis.news.tpi.pl...
> Hi,
> is there a possibility to create automaticaly a ODBC database connection
on
> the multiple client computers (equal for all of them), in ex. on windows
> 2000 Profesional or XP?
> And secont thing. Is there a possibility to automaticaly change all of the
> ODBC connections without changing one by one?
> Thanks for help.
> Marcin
>
sql

create same Database connection on multiple computers

Hi,
is there a possibility to create automaticaly a ODBC database connection on
the multiple client computers (equal for all of them), in ex. on windows
2000 Profesional or XP?
And secont thing. Is there a possibility to automaticaly change all of the
ODBC connections without changing one by one?
Thanks for help.
Marcinyes it is possible. Just create(or modify) the regkey from
HKEY_LOCAL_MACHINE
SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources\
SOFTWARE\ODBC\ODBC.INI\
You can do very easy a program to do all this change. I've made one, and it
works well
Gabriel Anton
Software Developer
----
--
"#'ak" <mkrzyz@.beretta.pl> wrote in message
news:cgfjtn$4v3$1@.atlantis.news.tpi.pl...
> Hi,
> is there a possibility to create automaticaly a ODBC database connection
on
> the multiple client computers (equal for all of them), in ex. on windows
> 2000 Profesional or XP?
> And secont thing. Is there a possibility to automaticaly change all of the
> ODBC connections without changing one by one?
> Thanks for help.
> Marcin
>

Thursday, March 8, 2012

Create odbc / sql

It is possible to create odbc through files? what is the code?
Thanks FrancescoDo you mean create a DSN? If so, check the following
examples:
HOWTO: Create and Remove a DSN in Visual Basic
http://support.microsoft.com/defaul...b;EN-US;q171146
HOWTO: Programmatically Create a DSN for SQL Server with VB
http://support.microsoft.com/defaul...b;EN-US;q184608
-Sue
On Tue, 24 Feb 2004 10:23:41 GMT, "Francesco Pellegatta"
<francesco@.pegasopoint.it> wrote:

>It is possible to create odbc through files? what is the code?
>Thanks Francesco
>

Wednesday, March 7, 2012

Create login account

I have installed MSDE 2000 on my computer. When I try to use ODBC to connect
to the data source, it keeps asking me to enter User Name and Password. Can
someone please tell me how I can create an account to connect to the SQL data
source?
> I have installed MSDE 2000 on my computer. When I try to use ODBC to
connect
> to the data source, it keeps asking me to enter User Name and Password.
Can
> someone please tell me how I can create an account to connect to the SQL
data
> source?
Here is a good starting point for MSDE security:
http://support.microsoft.com/default...;en-us;325022.
Dejan Sarka, SQL Server MVP
Associate Mentor
Solid Quality Learning
More than just Training
www.SolidQualityLearning.com

Tuesday, February 14, 2012

CREATE DATABASE failed

Does any body seen this message before?
Microsoft SQL-DMO (ODBC SQLState: 42000)
Error 1807: Could not obtain exclusive lock on database 'MODEL'. Retry the
operation later.
CREATE DATABASE failed. Some file names listed could not be created. Check
previous errors.
OK
Hi,
This error will occur if there is a user connected to model database. Run
sp_who to determine what connections are using model.
Identify those connetions and kill the SPID and try to create database
again.
Thanks
Hari
SQL Server MVP
"SQLCluster" <SQLCluster@.discussions.microsoft.com> wrote in message
news:24E3473B-9AD3-43C9-A668-07A7653DF676@.microsoft.com...
> Does any body seen this message before?
> --
> Microsoft SQL-DMO (ODBC SQLState: 42000)
> --
> Error 1807: Could not obtain exclusive lock on database 'MODEL'. Retry the
> operation later.
> CREATE DATABASE failed. Some file names listed could not be created. Check
> previous errors.
> --
> OK
> --
>

CREATE DATABASE failed

Does any body seen this message before?
Microsoft SQL-DMO (ODBC SQLState: 42000)
--
Error 1807: Could not obtain exclusive lock on database 'MODEL'. Retry the
operation later.
CREATE DATABASE failed. Some file names listed could not be created. Check
previous errors.
--
OK
--Hi,
This error will occur if there is a user connected to model database. Run
sp_who to determine what connections are using model.
Identify those connetions and kill the SPID and try to create database
again.
Thanks
Hari
SQL Server MVP
"SQLCluster" <SQLCluster@.discussions.microsoft.com> wrote in message
news:24E3473B-9AD3-43C9-A668-07A7653DF676@.microsoft.com...
> Does any body seen this message before?
> --
> Microsoft SQL-DMO (ODBC SQLState: 42000)
> --
> Error 1807: Could not obtain exclusive lock on database 'MODEL'. Retry the
> operation later.
> CREATE DATABASE failed. Some file names listed could not be created. Check
> previous errors.
> --
> OK
> --
>

CREATE DATABASE failed

Does any body seen this message before?
--
Microsoft SQL-DMO (ODBC SQLState: 42000)
--
Error 1807: Could not obtain exclusive lock on database 'MODEL'. Retry the
operation later.
CREATE DATABASE failed. Some file names listed could not be created. Check
previous errors.
--
OK
--Hi,
This error will occur if there is a user connected to model database. Run
sp_who to determine what connections are using model.
Identify those connetions and kill the SPID and try to create database
again.
Thanks
Hari
SQL Server MVP
"SQLCluster" <SQLCluster@.discussions.microsoft.com> wrote in message
news:24E3473B-9AD3-43C9-A668-07A7653DF676@.microsoft.com...
> Does any body seen this message before?
> --
> Microsoft SQL-DMO (ODBC SQLState: 42000)
> --
> Error 1807: Could not obtain exclusive lock on database 'MODEL'. Retry the
> operation later.
> CREATE DATABASE failed. Some file names listed could not be created. Check
> previous errors.
> --
> OK
> --
>