Page 1 of 1 1
Topic Options
#94005 - 2002-10-03 06:30 PM How do I script the creation of a User Data Source Name?
Lee Wilmott Offline
Starting to like KiXtart

Registered: 2002-09-17
Posts: 106
Loc: Bristol, UK
I need to configure a "User Data Source Name" on a number of machines of varying platforms (Win2K, NT4, WinXP).

I was hoping to script this with Kix within our Logon Script.

I've had a look at TechNet - albeit a quick look and I cannot see a way of doing this.

I've had a look at my registry and I can see the Data Source that I manually configured. (However, my password is missing).

Does anyone know whether or not I can automate this process?

Many thanks,

Lee

Top
#94006 - 2002-10-03 08:06 PM Re: How do I script the creation of a User Data Source Name?
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
I found a script that will create a DSN.. could be modified for your purpose, I believe (although it's in VBScript.)

http://www.swynk.com/winscript/SCRIPT_AutoDSN.asp

Brian

Top
#94007 - 2002-10-03 10:13 PM Re: How do I script the creation of a User Data Source Name?
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Hey Lee - hows it going ... I think Les and Jens and Kyder are masters of the DSN ... heres a link ... is this what your after ?

Topic: WinNT ODBC

Top
#94008 - 2002-10-03 10:15 PM Re: How do I script the creation of a User Data Source Name?
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Lee,

What Data Source are you connecting to? Visual FoxPro, Access, Oracle, SQL?

Thanks!

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#94009 - 2002-10-05 12:15 AM Re: How do I script the creation of a User Data Source Name?
Lee Wilmott Offline
Starting to like KiXtart

Registered: 2002-09-17
Posts: 106
Loc: Bristol, UK
[Smile] Thanks...All your comments are certainly putting me on the correct road for a successful implementation!

[Frown] Damn it! [Frown] As Kent so rightly pointed out...I forgot to say that I am using an "SQL Server"...Sorry!

I think that the database that we need to "connect" to will not use Windows Authentication, so I will need to specify a username and password for the database. Is it possible to script this?

Maybe the idea of automatically creating a User DSN would be useful for many people - Would anyone like to see it native to Kix?

Lee

Shawn...Yeah fine thanks - you? Things are pretty hectic here...We are going live with a database on Monday so I have to create hundreds of UDSN's; which as always I haven't got time for!

Top
#94010 - 2002-10-04 03:23 PM Re: How do I script the creation of a User Data Source Name?
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
Just curious.. why are you using User DSNs and not system DSNs?

Brian

Top
#94011 - 2002-10-04 04:03 PM Re: How do I script the creation of a User Data Source Name?
Lee Wilmott Offline
Starting to like KiXtart

Registered: 2002-09-17
Posts: 106
Loc: Bristol, UK
Brian,

Only because users can configure User DSN's and not System DSN's, and I don't fancy visiting every machine to configure a System DSN.

I thought if I create a User DSN then I could simply place it into a logon script.

What do you think?

Lee

Top
#94012 - 2002-10-04 04:28 PM Re: How do I script the creation of a User Data Source Name?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
You don't need a DSN at all since you can define them on the fly. See DBConnOpen() - Open a connection to a database using ADODB which contains examples to connect to the most populardatabases. You can provide usernames/passwords with this method, too.
_________________________
There are two types of vessels, submarines and targets.

Top
#94013 - 2002-10-04 06:32 PM Re: How do I script the creation of a User Data Source Name?
Lee Wilmott Offline
Starting to like KiXtart

Registered: 2002-09-17
Posts: 106
Loc: Bristol, UK
ah ha! Jens, that's what I said to our Database "guru".

We [will be - on Monday] are using an MS Access front end (ie. The Access database has all the forms and reports) and the data will be stored on a SQL Server.

He told me that each and every machine will require an DSN configured - and I said "you must be ******* joking!".

I thought you could put the "on-the-fly" code into the MS Access database contained within a "Startup" macro.

Is he talking ****?

Lee

Top
#94014 - 2002-10-04 06:36 PM Re: How do I script the creation of a User Data Source Name?
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
hehee - yeah - they're called DSNless connections - do a web search on it and mail a link or two to your guru-guy
Top
#94015 - 2002-10-04 06:57 PM Re: How do I script the creation of a User Data Source Name?
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
You might want to check out the UDF forum for ideas as well.. there is a lot of info in there on connecting to SQL via KiXtart.

Brian

Top
#94016 - 2002-10-04 08:44 PM Re: How do I script the creation of a User Data Source Name?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Shawn is right. They are DNS-less connections. However, the disavantage fo a DSN-less connection is that you have your password in your script or wherever you create the connection.
_________________________
There are two types of vessels, submarines and targets.

Top
#94017 - 2002-10-04 10:31 PM Re: How do I script the creation of a User Data Source Name?
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
DSN-Less is the way to fly..

DBQ Baby!!

[Razz]

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#94018 - 2002-10-10 06:05 PM Re: How do I script the creation of a User Data Source Name?
Lee Wilmott Offline
Starting to like KiXtart

Registered: 2002-09-17
Posts: 106
Loc: Bristol, UK
Just a quick thank you!

All your comments helped in finding a solution to our problem.

Because of all the suggestions I have had, our database "guru" [Confused] is putting in the changes I requested!

Thank you once again.

Lee

Top
Page 1 of 1 1


Moderator:  Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 641 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.041 seconds in which 0.016 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org