Hello!
Does FW access MS-SQl Server as well as access MySQL?
Tks
Rodrigo Melo
Brazil
FW MS-SQL Server
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
- Rick Lipkin
- Posts: 2397
- Joined: Fri Oct 07, 2005 1:50 pm
- Location: Columbia, South Carolina USA
Re: FW MS-SQL Server
Ado connects to most Sql Databases ... go to the website Connectionstrings.com
https://www.connectionstrings.com/ole-d ... ql-server/
Or have a look at
\source\function\adofuncs.prg ... simplified ado wrappers
Rick Lipkin
https://www.connectionstrings.com/ole-d ... ql-server/
Code: Select all
xPROVIDER := "SQLOLEDB"
xSOURCE := "MYCOMUTER-PC\SQLEXPRESS"
xCatalog := "MyDatabaseName"
xUserId := "sqluserID"
xPASSWORD := "mypassword"
xString := 'Provider='+xPROVIDER+';Data Source='+xSOURCE+';Initial Catalog='+xCATALOG+';User Id='+xUSERID+';Password='+xPASSWORD
// global connection string
xConnect := CREATEOBJECT( "ADODB.Connection" )
TRY
xConnect:Open( xString )
CATCH oErr
Saying := "Could not open a Global Connection to Database "+xSource
MsgInfo( Saying )
RETURN(.F.)
END TRY
\source\function\adofuncs.prg ... simplified ado wrappers
Rick Lipkin
Re: FW MS-SQL Server
Rick,
Tks
Tks
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: FW MS-SQL Server
FWH recommends:
You need not bother about connection strings. FWH does all that work for you.
Code: Select all
oCn := FW_OpenAdoConnection( { "MSSQL", cServer, cCatalog, cUser, cPassword }, .t. )
if oCn == nil
? "not connected"
return nil
// do your work
oCn:Close()
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India