Board index » delphi » D2 SQL Links and MS SQL Server 6.5

D2 SQL Links and MS SQL Server 6.5

I can't connect to the MSSQL 6.5 using D2. ISQL_W connects fine. Any
attemp to connect using Database Desktop or Database Explorer gives
a SQL error message. Following are some details.

SQL Server and D2 are running on the same NT server machine.
SQLServer service is running.
The SQL server is named CRAY.
A new alias is defined in the BDE, giving D:\MSSQL\DATA\MASTER.DAT
as the DATABSE NAME and CRAY as the SERVER NAME (we have also tried
the default name MSSQL SERVER).
When we provide the user id and password in the connect dialog box,
we get back a SQL error saying error in the statement, line 1, near
"D:" (see our value for DATABSE NAME above). Then we tried to move
D:\MSSQL\DATA\ to the PATH field and MASTER.DAT in the DATABASE NAME
field, this time we got the error message saying error in the
statement, line 1, near ".".

What gives? What are we doing wrong?

Any help will be appreciated. Thanks.

Regards,
Nasir (nn...@cris.com)

 

Re:D2 SQL Links and MS SQL Server 6.5


Quote
NNOOR wrote:

> SQL Server and D2 are running on the same NT server machine.
> SQLServer service is running.
> The SQL server is named CRAY.
> A new alias is defined in the BDE, giving D:\MSSQL\DATA\MASTER.DAT
> as the DATABSE NAME and CRAY as the SERVER NAME (we have also tried

----Sounds like this is the problem.  See below.

Quote
> the default name MSSQL SERVER).
> When we provide the user id and password in the connect dialog box,
> we get back a SQL error saying error in the statement, line 1, near
> "D:" (see our value for DATABSE NAME above). Then we tried to move
> D:\MSSQL\DATA\ to the PATH field and MASTER.DAT in the DATABASE NAME
> field, this time we got the error message saying error in the
> statement, line 1, near ".".
> Regards,
> Nasir (nn...@cris.com)

I think the problem you are experiencing is that the 'database name' is
not the path and file name, such as on the table component.  It is the
actual name of the database that you set up in MS SQL Sever, e.g.
'purch', or 'hr', or 'MyDatabase'.  It is the name that you see when you
go into SQL Enterprise Manager/CRAY/DataBases/Objects or whatever.

Also, using aliases is a HUGE pain in Delphi.  I recommend that you drop
a database component on the form and use it instead.  
1.  Drop it on the form.
2.  Double click it.
3.  In the name field in the dialog that pops up, enter the name you
want to access it by, i.e. 'mydatabase'.
4.  Under driver name, select 'MSSQL'.
5.  Click defaults.
6.  You will see the following: Set database name, server name, and
password.
DATABASE NAME=mydatabase
SERVER NAME=cray
USER NAME=dbo --------or whatever you set up
OPEN MODE=READ\WRITE
SCHEMA CACHE SIZE=8
BLOB EDIT LOGGING=
LANGDRIVER=
SQLQRYMODE=
SQLPASSTHRU MODE=SHARED NOAUTOCOMMIT
DATE MODE=0
SCHEMA CACHE TIME=-1
MAX QUERY TIME=300
MAX ROWS=-1
BATCH COUNT=200
ENABLE SCHEMA CACHE=FALSE
SCHEMA CACHE DIR=
HOST NAME=
APPLICATION NAME=
NATIONAL LANG NAME=
ENABLE BCD=FALSE
TDS PACKET SIZE=512
PASSWORD=   ------------if you need to.
7. I recommend that you uncheck the 'login prompt' option.

Now, when you drop on a table, query, or preferable a stored procedure
component, and you select database name, select mydatabase.  Now you
don't have to worry about aliases and distribution of them.

Hope this helps,
Jason Perry.

Re:D2 SQL Links and MS SQL Server 6.5


On 16 Jan 1997 13:09:18 GMT, Nn...@cris.com (NNOOR) wrote:

Quote
>I can't connect to the MSSQL 6.5 using D2. ISQL_W connects fine. Any
>attemp to connect using Database Desktop or Database Explorer gives
>a SQL error message. Following are some details.

>SQL Server and D2 are running on the same NT server machine.
>SQLServer service is running.
>The SQL server is named CRAY.
>A new alias is defined in the BDE, giving D:\MSSQL\DATA\MASTER.DAT
>as the DATABSE NAME and CRAY as the SERVER NAME (we have also tried
>the default name MSSQL SERVER).
>When we provide the user id and password in the connect dialog box,
>we get back a SQL error saying error in the statement, line 1, near
>"D:" (see our value for DATABSE NAME above). Then we tried to move
>D:\MSSQL\DATA\ to the PATH field and MASTER.DAT in the DATABASE NAME
>field, this time we got the error message saying error in the
>statement, line 1, near ".".

>What gives? What are we doing wrong?

>Any help will be appreciated. Thanks.

>Regards,
>Nasir (nn...@cris.com)

Nasir,

The DATABASE NAME should be the name of the database on the server not
the DOS file name of the device file.  So to access the master
database, just put MASTER in the database name.  Put nothing at all in
the path, and put the actual name of your server in the SERVER NAME
field.  That is all you should need to do.

Dan Martini
Black Forest Software Corporation

Other Threads