Page 1 of 1 1
Topic Options
#92345 - 2003-07-04 11:18 PM Connecting to SQL using KiX
Darkwin Offline
Fresh Scripter

Registered: 2003-01-04
Posts: 12
Loc: Assen, The Netherlands
Hello

How can I connect to a sql server with KiX

Things

Top
#92346 - 2003-07-04 11:33 PM Re: Connecting to SQL using KiX
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Think your work is as follows:

1) Use ADO
2) Get the DSN correct. Read this thread
3) or: Get the DSN correct and use Jen's DB functions in the UDF library.

-Shawn

[ 04. July 2003, 23:33: Message edited by: Shawn ]

Top
#92347 - 2003-07-07 04:28 AM Re: Connecting to SQL using KiX
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
You could start with this UDF: DBCommand() - Executes a SQL statement and returns a recordset if applicable
_________________________
There are two types of vessels, submarines and targets.

Top
#92348 - 2003-07-17 12:07 AM Re: Connecting to SQL using KiX
New Mexico Mark Offline
Hey THIS is FUN
****

Registered: 2002-01-03
Posts: 223
Loc: Columbia, SC
That may be exactly what I'm looking for. I'll test tomorrow. The tricky thing is supplying credentials. Since these are standalone servers, I can't just use a domain admin account. Even the built-in administrator on these servers has been renamed to different names. A lot of this is for security (both external and internal since we are working with dozens of businesses / development groups). It's a royal pain, but it is where we are at right now.

Thanks,

Mark

Top
#92349 - 2003-07-17 12:23 AM Re: Connecting to SQL using KiX
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
You can always use a Trusted_Connection with SQL server. This will permit you execute script under the context of any NT account as long as that account was granted the required level of access on the SQL server.

See for info on the connect string: http://www.kixtart.org/board/ultimatebb.php?ubb=get_topic;f=2;t=004475#000005
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#92350 - 2003-07-17 01:13 AM Re: Connecting to SQL using KiX
Anonymous
Unregistered


As Howard indicated, using a trusted connection saves you some of the trouble in setting up a DSN using SQL-based authentication. You just need to make sure that your security settings are properly configured on the server end. Here's an example of a connect string I use to connect to SQL server using a trusted connection.

$ConnectString = "Provider=sqloledb;DataSource=SOMESQLSERVER;Initial Catalog=THEDATABASE;Integrated Security=SSPI"

$ADOConn = CreateObject("ADODB.Connection")
IF @ERROR=0
$ADOConn.Open($ConnectString)
ENDIF

Here's a nice link that shows you how to assemble a connection string to a multitude of DB providers:

http://www.able-consulting.com/MDAC/ADO/Connection/OLEDB_Providers.htm

-Ron

Top
#92351 - 2003-07-19 03:50 PM Re: Connecting to SQL using KiX
Darkwin Offline
Fresh Scripter

Registered: 2003-01-04
Posts: 12
Loc: Assen, The Netherlands
Thanks, [Big Grin]

It works.

Top
Page 1 of 1 1


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

Who's Online
0 registered and 811 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.061 seconds in which 0.026 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