As said in a previous post, I am beginning to experiment with SQLServer,
using SQLServer 2005 Std Ed. on an XP Prof SP2 machine.
I managed to build my first edit form, using an ODBC connection.
I created an ODBC connection called MYCONNECTION, which uses the database
called TEST, and a table called CUSTOMERS.
if I use:
cConnString = 'MYCONNECTION'
and
nHandle = SQLConnect(cConnString)
the connection is succesful
If instead I use:
cConnString='Provider=SQLNCLI.1;Integrated Security=SSPI;Persist Security
Info=False;Initial Catalog=test;Data Source=RAFAELPC\SQLEXPRESS'
I have to use:
nHandle = SQLStringConnect(cConnString)
This opens a dialog forcing me to choose the MYCONNECTION ODBC source, and
then the connection succeeds.
Questions:
1) why does the above dialog appear and how can I get rid of it?
2) why does sqlconnect not work with the second connection string (the long
one)?
Can anyone give me the answers?
TIA
Rafael Copquin
On Thu, Jan 15, 2009 at 6:53 AM, Rafael Copquin <rcopquin@ciudad.com.ar> wrote:
> As said in a previous post, I am beginning to experiment with SQLServer,
> using SQLServer 2005 Std Ed. on an XP Prof SP2 machine.
>
> I managed to build my first edit form, using an ODBC connection.
>
> I created an ODBC connection called MYCONNECTION, which uses the database
> called TEST, and a table called CUSTOMERS.
>
> if I use:
>
> cConnString = 'MYCONNECTION'
>
> and
>
> nHandle = SQLConnect(cConnString)
>
> the connection is succesful
>
> If instead I use:
>
> cConnString='Provider=SQLNCLI.1;Integrated Security=SSPI;Persist Security
> Info=False;Initial Catalog=test;Data Source=RAFAELPC\SQLEXPRESS'
>
> I have to use:
>
> nHandle = SQLStringConnect(cConnString)
>
> This opens a dialog forcing me to choose the MYCONNECTION ODBC source, and
> then the connection succeeds.
>
> Questions:
>
> 1) why does the above dialog appear and how can I get rid of it?
> 2) why does sqlconnect not work with the second connection string (the long
> one)?
>
> Can anyone give me the answers?
------------------------
You said 2005? Your Driver statement doesn't look right. Try either
versions of text for your conn string:
SQL Native Client 9.0 ODBC Driver
Type: ODBC Driver
Usage: Driver={SQL Native Client}
Manufacturer: Microsoft
Standard security
Driver={SQL Native Client};Server=myServerAddress;Database=myDataBase;
Uid=myUsername;Pwd=myPassword;
Are you using SQL Server 2005 Express? Don't miss the server name
syntax Servername\SQLEXPRESS where you substitute Servername with the
name of the computer where the SQL Server 2005 Express installation
resides.
Trusted Connection
Driver={SQL Native Client};Server=myServerAddress;Database=myDataBase;
Trusted_Connection=yes;
HTH
from <http://www.connectionstrings.com/sql-server-2005#109>
--
Stephen Russell
Sr. Production Systems Programmer
First Horizon Bank
Memphis TN
901.246-0159
Thank you very much Steve!!
I changed the connection string to:
cConnString = 'Driver={SQL Native
Client};Server=RAFAELPC\SQLEXPRESS;Database=test;Trusted_Connection=yes')
It worked like a charm.
Rafael Copquin
Stephen,
Is ODBC the only way to connect to the sql server or is there any other
options.
I am also new and I have installed sql server 2005 express edition.
for odbc do I have to install a sql server odbc driver ???
Plus I read there are two ways to go views & sql pasthrough. Which one would
be easy for a desktop application. No web.
Ajoy Khaund
Neamati Road
Near Bhogdoi Bridge
Jorhat 785001-21
Assam, India
Tel: 91-376-2351288
Cell: 91-94350-92287
Mail: akhaund@hotmail.com
Mail: akhaund@gmail.com
"Walking on water and developing software from a specification are easy if
both are frozen."
- Edward V. Berard, "Life-Cycle Approaches"
--------------------------------------------------
From: "Stephen Russell" <srussell705@gmail.com>
Sent: Thursday, January 15, 2009 8:09 PM
To: <profoxtech@leafe.com>
Subject: Re: VFP and SQLServer 2005 Std Edition
> On Thu, Jan 15, 2009 at 6:53 AM, Rafael Copquin <rcopquin@ciudad.com.ar>
> wrote:
>> As said in a previous post, I am beginning to experiment with SQLServer,
>> using SQLServer 2005 Std Ed. on an XP Prof SP2 machine.
>>
>> I managed to build my first edit form, using an ODBC connection.
>>
>> I created an ODBC connection called MYCONNECTION, which uses the database
>> called TEST, and a table called CUSTOMERS.
>>
>> if I use:
>>
>> cConnString = 'MYCONNECTION'
>>
>> and
>>
>> nHandle = SQLConnect(cConnString)
>>
>> the connection is succesful
>>
>> If instead I use:
>>
>> cConnString='Provider=SQLNCLI.1;Integrated Security=SSPI;Persist Security
>> Info=False;Initial Catalog=test;Data Source=RAFAELPC\SQLEXPRESS'
>>
>> I have to use:
>>
>> nHandle = SQLStringConnect(cConnString)
>>
>> This opens a dialog forcing me to choose the MYCONNECTION ODBC source,
>> and
>> then the connection succeeds.
>>
>> Questions:
>>
>> 1) why does the above dialog appear and how can I get rid of it?
>> 2) why does sqlconnect not work with the second connection string (the
>> long
>> one)?
>>
>> Can anyone give me the answers?
> ------------------------
>
> You said 2005? Your Driver statement doesn't look right. Try either
> versions of text for your conn string:
>
> SQL Native Client 9.0 ODBC Driver
> Type: ODBC Driver
> Usage: Driver={SQL Native Client}
> Manufacturer: Microsoft
>
> Standard security
> Driver={SQL Native Client};Server=myServerAddress;Database=myDataBase;
> Uid=myUsername;Pwd=myPassword;
>
> Are you using SQL Server 2005 Express? Don't miss the server name
> syntax Servername\SQLEXPRESS where you substitute Servername with the
> name of the computer where the SQL Server 2005 Express installation
> resides.
>
> Trusted Connection
> Driver={SQL Native Client};Server=myServerAddress;Database=myDataBase;
> Trusted_Connection=yes;
>
> HTH
>
> from <http://www.connectionstrings.com/sql-server-2005#109>
>
>
>
> --
> Stephen Russell
> Sr. Production Systems Programmer
> First Horizon Bank
> Memphis TN
>
> 901.246-0159
>
>
[excessive quoting removed by server]
>>for odbc do I have to install a sql server odbc driver ???<<
The SQL Client is installed when you install SQL Server 2005. It can be installed separately too
(which you need during your deployment).
>> Plus I read there are two ways to go views & sql pasthrough. Which one would be easy for a
desktop application. No web.<<
Easy is a relative term <g>. VFP 8 and 9 also have CursorAdapters. One other thing to consider is
you can mix and match them in the app. For instance you can use Remote Views or CursorAdapters for
data entry forms because they simplify the CRUD operations and metadata management with a small
sacrifice in performance. Then use SQL Passthrough for reporting and analysis because it provides
you simplified and fully flexible querying. Or you can standardize on one approach to have a
consistent data management strategy.
Lots of choices.
Rick
White Light Computing, Inc.
www.whitelightcomputing.com
www.swfox.net
www.rickschummer.com
On Fri, Jan 16, 2009 at 8:19 AM, Ajoy Khaund <akhaund@gmail.com> wrote:
> Stephen,
>
> Is ODBC the only way to connect to the sql server or is there any other
> options.
>
> I am also new and I have installed sql server 2005 express edition.
>
> for odbc do I have to install a sql server odbc driver ???
>
> Plus I read there are two ways to go views & sql pasthrough. Which one would
> be easy for a desktop application. No web.
----------------------------------
Rick summed it up pretty well.
Yes you need the driver.
You can do view or pass through or a combination. I personaly only
did pass through but that was before cursor adapters were created. I
have heard good things about their improvements but no hands on
experience.
--
Stephen Russell
Sr. Production Systems Programmer
First Horizon Bank
Memphis TN
901.246-0159
Thankz to both. Let me do something and get back.
Ajoy Khaund
Neamati Road
Near Bhogdoi Bridge
Jorhat 785001-21
Assam, India
Tel: 91-376-2351288
Cell: 91-94350-92287
Mail: akhaund@hotmail.com
Mail: akhaund@gmail.com
"Walking on water and developing software from a specification are easy if
both are frozen."
- Edward V. Berard, "Life-Cycle Approaches"
--------------------------------------------------
From: "Stephen Russell" <srussell705@gmail.com>
Sent: Friday, January 16, 2009 8:43 PM
To: <profoxtech@leafe.com>
Subject: Re: VFP and SQLServer 2005 Std Edition
> On Fri, Jan 16, 2009 at 8:19 AM, Ajoy Khaund <akhaund@gmail.com> wrote:
>> Stephen,
>>
>> Is ODBC the only way to connect to the sql server or is there any other
>> options.
>>
>> I am also new and I have installed sql server 2005 express edition.
>>
>> for odbc do I have to install a sql server odbc driver ???
>>
>> Plus I read there are two ways to go views & sql pasthrough. Which one
>> would
>> be easy for a desktop application. No web.
> ----------------------------------
>
> Rick summed it up pretty well.
>
> Yes you need the driver.
>
> You can do view or pass through or a combination. I personaly only
> did pass through but that was before cursor adapters were created. I
> have heard good things about their improvements but no hands on
> experience.
>
> --
> Stephen Russell
> Sr. Production Systems Programmer
> First Horizon Bank
> Memphis TN
>
> 901.246-0159
>
>
[excessive quoting removed by server]