From: astinter on
I am very new with SQL server. I created a database using SQL Server
management
studio express. Before shell window starts I have a login dialog where
user should write
server name, user name and password and as result of this I get three
global variables which
I named: cServer, cUser and cPass. I want to use this variables in
connection string later when
I open a datawindow. I use bBrowser. I tried with some samples in this
NG and also samples
with VO 2.7 which I have, but with no result.

Zeljko V.
From: George Theopoulos on
<astinter(a)gmail.com> wrote in message
news:1ae12e90-1a88-46b3-8c46-ac2d7162f865(a)o40g2000prn.googlegroups.com...
>
> I am very new with SQL server. I created a database using SQL Server
> management
> studio express. Before shell window starts I have a login dialog where
> user should write
> server name, user name and password and as result of this I get three
> global variables which
> I named: cServer, cUser and cPass. I want to use this variables in
> connection string later when
> I open a datawindow. I use bBrowser. I tried with some samples in this
> NG and also samples
> with VO 2.7 which I have, but with no result.
>
> Zeljko V.

Zeljko,

there are 2 ways to connect to a SQL Server:

1. Using Integrated Security (Windows)
the connecttion string might be:

cConnectString:="Provider=SQLNCLI;" + ;
"Server="+cServer+";" + ;
"Database="+cDatabase+";" + ;
"Trusted_Connection=yes;"


2. Using SQL Authentication (if you installed the SQL Server Express to have
both authentications: Windows and SQL)
cConnectString:="Provider=SQLNCLI;" + ;
"Server="+cServer+";" + ;
"Database="+cDatabase+";" + ;
"User Id="+cUser +";" + ;
"Password="+cPass+";"

I don't know if you installed the SQL Server as default or named instance.
In any case, the cServer will be something like:

"ComputerName"
or
"ComputerName\SQLExpress"
or
"ComputerName\SpecifiedNameOfSqlInstance"


then, create and open the SQLConnection object:

GLOBAL oConn as AdoConnection

....
BEGIN SEQUENCE

oConn:=AdoConnection{}
// Set the ConnectionTimeout in Seconds
oConn:ConnectionTimeout:=10
// Set the CommandTimeout in Seconds
oConn:CommandTimeout:=600

oConn:Open(cConnectString, NIL, NIL, NIL)
//adUseNone 1 Does not use cursor services. (obsolete)
//adUseServer 2 Default. Uses data-provider or driver-supplied cursors.
//adUseClient 3 Uses client-side cursors supplied by a LOCAL cursor
library.
oConn:CursorLocation:=adUseClient

AdoSetConnection(oConn)
AdoDateTimeAsDate(TRUE) // DD/MM/YYYY HH:MM:SS -> DD/MM/YY

RECOVER USING uError
? uError:description
END SEQUENCE

then, you may create AdoServer or any other ADO object using this oConn
SQLConnection object.

Regards
George

From: astinter on
On Nov 12, 9:28 pm, "George Theopoulos" <geor...(a)softway.gr> wrote:
> <astin...(a)gmail.com> wrote in message
>
> news:1ae12e90-1a88-46b3-8c46-ac2d7162f865(a)o40g2000prn.googlegroups.com...
>
>
>
> > I am very new with SQL server. I created a database using SQL Server
> > management
> > studio express. Before shell window starts I have a login dialog where
> > user should write
> > server name, user name and password and as result of this I get three
> > global variables which
> > I named: cServer, cUser and cPass. I want to use this variables in
> > connection string later when
> > I open a datawindow. I use bBrowser. I tried with some samples in this
> > NG and also samples
> > with VO 2.7 which I have, but with no result.
>
> > Zeljko V.
>
> Zeljko,
>
> there are 2 ways to connect to a SQL Server:
>
> 1. Using Integrated Security (Windows)
> the connecttion string might be:
>
> cConnectString:="Provider=SQLNCLI;" + ;
> "Server="+cServer+";" + ;
> "Database="+cDatabase+";" + ;
> "Trusted_Connection=yes;"
>
> 2. Using SQL Authentication (if you installed the SQL Server Express to have
> both authentications: Windows and SQL)
> cConnectString:="Provider=SQLNCLI;" + ;
> "Server="+cServer+";" + ;
> "Database="+cDatabase+";" + ;
> "User Id="+cUser +";" + ;
> "Password="+cPass+";"
>
> I don't know if you installed the SQL Server as default or named instance..
> In any case, the cServer will be something like:
>
> "ComputerName"
> or
> "ComputerName\SQLExpress"
> or
> "ComputerName\SpecifiedNameOfSqlInstance"
>
> then, create and open the SQLConnection object:
>
> GLOBAL oConn as AdoConnection
>
> ...
> BEGIN SEQUENCE
>
>  oConn:=AdoConnection{}
>  // Set the ConnectionTimeout in Seconds
>  oConn:ConnectionTimeout:=10
>  // Set the CommandTimeout in Seconds
>  oConn:CommandTimeout:=600
>
>  oConn:Open(cConnectString, NIL, NIL, NIL)
>  //adUseNone    1    Does not use cursor services. (obsolete)
>  //adUseServer  2    Default. Uses data-provider or driver-supplied cursors.
>  //adUseClient  3    Uses client-side cursors supplied by a LOCAL cursor
> library.
>  oConn:CursorLocation:=adUseClient
>
>  AdoSetConnection(oConn)
>  AdoDateTimeAsDate(TRUE)         // DD/MM/YYYY HH:MM:SS -> DD/MM/YY
>
> RECOVER USING uError
> ? uError:description
> END SEQUENCE
>
> then, you may create AdoServer or any other ADO object using this oConn
> SQLConnection object.
>
> Regards
> George


George,
it's works.
Now, the first step is done.
Thanks.

Zeljko V.
From: Geoff Schaller on
Zeljko,

You will have to do better than that! How about showing us the
connection code etc? A lot of people are working fine with SQL Server.
Have you tried the standalone examples Robert provides? They all work.

Geoff



"astinter(a)gmail.com" <astinter(a)gmail.com> wrote in message
news:1ae12e90-1a88-46b3-8c46-ac2d7162f865(a)o40g2000prn.googlegroups.com:

> I am very new with SQL server. I created a database using SQL Server
> management
> studio express. Before shell window starts I have a login dialog where
> user should write
> server name, user name and password and as result of this I get three
> global variables which
> I named: cServer, cUser and cPass. I want to use this variables in
> connection string later when
> I open a datawindow. I use bBrowser. I tried with some samples in this
> NG and also samples
> with VO 2.7 which I have, but with no result.
>
> Zeljko V.


__________ Information from ESET NOD32 Antivirus, version of virus
signature database 3607 (20081112) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


From: astinter on
On Nov 12, 10:13 pm, "Geoff Schaller"
<geo...(a)softxwareobjectives.com.au> wrote:
> Zeljko,
>
> You will have to do better than that! How about showing us the
> connection code etc? A lot of people are working fine with SQL Server.
> Have you tried the standalone examples Robert provides? They all work.
>
> Geoff
>
> "astin...(a)gmail.com" <astin...(a)gmail.com> wrote in message
>
> news:1ae12e90-1a88-46b3-8c46-ac2d7162f865(a)o40g2000prn.googlegroups.com:
>
> > I am very new with SQL server. I created a database using SQL Server
> > management
> > studio express. Before shell window starts I have a login dialog where
> > user should write
> > server name, user name and password and as result of this I get three
> > global variables which
> > I named: cServer, cUser and cPass. I want to use this variables in
> > connection string later when
> > I open a datawindow. I use bBrowser. I tried with some samples in this
> > NG and also samples
> > with VO 2.7 which I have, but with no result.
>
> > Zeljko V.
>
> __________ Information from ESET NOD32 Antivirus, version of virus
> signature database 3607 (20081112) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com



I used Robert's code and its works fine.
Now, I have some other problems using ADO but I will try to solve it
by myself and if I couldn't solve it I'll ask a question on this
forum.
Geoff, you helped me many times on this forum.

Zeljko