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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using VFP to enumrate names of SQL datbases

Status
Not open for further replies.

oppy

IS-IT--Management
Nov 27, 2001
2
US
I have tried 'connecting' to an SQL server across our LAN by configuring ODBC through the Control Panel of my WinXP machine, then tried to get VFP 7.0SP1 to Query the Master database so that I can enumerate the database names on that SQL server.

However the ODBC is having difficulty logging me into the Server.

Is that what I should be doing? Is there an easier way to do this? I really need to do it programatically.

Thanks,
Oppy


 
( sorry for may bad english )

You can use connect string to connect to the server:

nHandle = SQLSTRINGCONNECT( "driver=SQL Server;server=(local);" + ;
"UID=" + cUsed_ID + ";" + ;
"PWD=" + cPassword + ";" + ;
"APP=" + cApplication_name + ";" + ;
"DATABASE=" + cDatabase_name + ";" + ;
"LANGUAGE=english" )


The APP is optional, this string is loged into server log file , etc.

The "server" may be (local) ( on computer, where the server is instaled ) or the name of the SQL server such as MY_SQL_SERVER , usually network name of computer

----------------------------------------------------------
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
----------------------------------------------------------
But, if you are installing MSDE from Visual foxpro CD on WinXP, the SQL server will be installed with Windows Authentication. ( you must use names and passwords of users, which has account in your WinXP ). If you want use names and
passwords which you create on SQL server, you must uninstall server, create file setup.ini somewhere on disk, put into this two lines

[Options]
SECURITYMODE=SQL

and then install MSDE from command prompt from Visual Foxpo CD like this

setup.exe /settings setup.ini

( setup.ini can has path to this file like "C:\somewhere\setup.ini" )

( See readme.txt on the install CD )

Zhavic
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top