Showing posts with label dear. Show all posts
Showing posts with label dear. Show all posts

Friday, March 30, 2012

Problem running package with 'larger' amount of data

Dear,

I created a package getting data from files and database sources, doing some transformations, retrieving dimension id's and then inserting it into a fact table.

Running this package with a limited amount of data (about a couple of 100.000 records) does not result in any errors and everything goes fine.

Now running the same package (still in debug mode) with more data (about 2.000.000 rows) doesn't result in any errors as well, but it just stops running. In fact, it doesn't really stop, but it doesn't continue as well. If I've only been waiting for some minutes or hours, I could think it's still processing, but I waited for about a day and it still is 'processing' the same step.

Any ideas on how to dig further into this in order to find the problem? Or is this a known problem?

Thanks for your ideas,

Jievie

Look at the BuffersSpooled perf counter. If it's really up there, you're thrashing the disk.

Also, just look task manager under the performance tab. Look at Physical Memory available. Chances are, you're running up against memory limitations.

Depending on what your pipeline contains, you should be able to optimize out the bottlenecks as well as eliminate any applications running that may be competing for resources.

This white paper is helpful:

http://www.microsoft.com/technet/prodtechnol/sql/2005/ssisperf.mspx

K

|||

Dear Jievie,

Could it be possible that the package tries to update a row locked by an other application?

Succes,

Paul

|||

Dear KirkHaselden and Paul,

In the meanwhile, I did some checks you both proposed me to do and can tell you the following:

I can't imagine another application is locking any rows or tables, as my sources are some flat files and two tables that are only used by my SSIS package. I also checked the system views (for the tables), no locks are listed...|||

There are three things you're not telling us ... how much memory you have, what transformations you are performing, and how big your rows are.

You are indicating you are memory constrained, but we don't know how much is involved.

The transformations are important - some transformations such as sort, or lookup, or aggregate, can require a lot of memory. Others, such as data conversion are very lightweight.

You can see the size of your rows by double clicking on the paths between transformations and looking at the metadata tab there - it will tell you what data types you are using for each row, and from there you can start to get the size of the row. (Remember folks, "row" is not a useful metric - we've seen rows from a few bytes to several megabytes being passed through SSIS.)

Once you get us this additional information, we should be able to help more. And do read the performance whitepaper - it will give you many useful suggestions.

thanks

Donald

Wednesday, March 28, 2012

Problem restoring transaction log

Dear all
I have a problem restoring a transaction log backup.
Platform SQL Server 2000 Standard Edition SP 2
Recovery mode = FULL
Transaction log backed up when empty to give us a nice
point to return to after some tests.
Backup was performed with Enterprise Manager.
Tlog has been grown from 23Gb to 46Gb after backup to
accommodate large load of transactions.
No dump device was created when backing up Tlog. Tlog
backed up to a file.
Filename: D:\DBSYS\MSSQL\BACKUP\SD70DbR7-Empty-Tlog
When restoring in Enterprise Manager (no matter what
options I choose) I get the infamous message:
The preceding restore operation did not specify WITH
NORECOVERY or WITH STANDBY.
Restart the restore sequence, specifying WITH NORECOVERY
or WITH STANDBY for all but the final step.
I've tried from filegroups and from devices. Specified
backups and specified "Leave DB non-operational
for more Tlog restores"
No joy.
I've tried to use a standalone restore script:
RESTORE LOG SD70DbR7
FROM DISK ='D:\DBSYS\MSSQL\BACKUP\SD70DbR7-Empty-Tlog'
WITH RECOVERY
I get the same message.
I have to specify a file as the TLog is not backed up to a
backup device.
This could be a big mistake on my part
I've specified WITH NORECOVERY and still the same message.
I've said FILE=1 but sill the same message.
When I leave out the very necessary FROM statement I get
teh nice message:
RESTORE LOG successfully processed 0 pages in 0.000
seconds (0.000 MB/sec).
I have some theories as to why I can't restore my TLog but
it seems obscene:
Could the fact that this database has not been backed up
be the issue?
Not on a suitable service pack.
Any suggestions?
Thanks
/SteveYou have to restore the database before you can restore the log. The error
message is saying that you did not do a restore leaving the server in
"norecovery" or "standby" mode so you cannot restore the log. Restore the
database backup and all log backups before that t-log backup using
norecovery and then apply that restore with recovery.
Christian Smith
"Steven Devaney" <Steven.Devaney@.Nospam.thx> wrote in message
news:1281a01c3f646$a327e430$a401280a@.phx
.gbl...
> Dear all
> I have a problem restoring a transaction log backup.
> Platform SQL Server 2000 Standard Edition SP 2
> Recovery mode = FULL
> Transaction log backed up when empty to give us a nice
> point to return to after some tests.
> Backup was performed with Enterprise Manager.
> Tlog has been grown from 23Gb to 46Gb after backup to
> accommodate large load of transactions.
> No dump device was created when backing up Tlog. Tlog
> backed up to a file.
> Filename: D:\DBSYS\MSSQL\BACKUP\SD70DbR7-Empty-Tlog
> When restoring in Enterprise Manager (no matter what
> options I choose) I get the infamous message:
> The preceding restore operation did not specify WITH
> NORECOVERY or WITH STANDBY.
> Restart the restore sequence, specifying WITH NORECOVERY
> or WITH STANDBY for all but the final step.
> I've tried from filegroups and from devices. Specified
> backups and specified "Leave DB non-operational
> for more Tlog restores"
> No joy.
> I've tried to use a standalone restore script:
> RESTORE LOG SD70DbR7
> FROM DISK ='D:\DBSYS\MSSQL\BACKUP\SD70DbR7-Empty-Tlog'
> WITH RECOVERY
> I get the same message.
> I have to specify a file as the TLog is not backed up to a
> backup device.
> This could be a big mistake on my part
> I've specified WITH NORECOVERY and still the same message.
> I've said FILE=1 but sill the same message.
> When I leave out the very necessary FROM statement I get
> teh nice message:
> RESTORE LOG successfully processed 0 pages in 0.000
> seconds (0.000 MB/sec).
> I have some theories as to why I can't restore my TLog but
> it seems obscene:
> Could the fact that this database has not been backed up
> be the issue?
> Not on a suitable service pack.
> Any suggestions?
>
> Thanks
> /Steve
>|||Thank you Christian.
As there is no space to do a backup to, I will have to go
for a plan B.
Thanks for the advice - at least it stops me searching for
something that can't be done.
>--Original Message--
>You have to restore the database before you can restore
the log. The error
>message is saying that you did not do a restore leaving
the server in
>"norecovery" or "standby" mode so you cannot restore the
log. Restore the
>database backup and all log backups before that t-log
backup using
>norecovery and then apply that restore with recovery.
>Christian Smith
>"Steven Devaney" <Steven.Devaney@.Nospam.thx> wrote in
message
> news:1281a01c3f646$a327e430$a401280a@.phx
.gbl...
to a
message.
but
>
>.
>sql

Problem restoring transaction log

Dear all
I have a problem restoring a transaction log backup.
Platform SQL Server 2000 Standard Edition SP 2
Recovery mode = FULL
Transaction log backed up when empty to give us a nice
point to return to after some tests.
Backup was performed with Enterprise Manager.
Tlog has been grown from 23Gb to 46Gb after backup to
accommodate large load of transactions.
No dump device was created when backing up Tlog. Tlog
backed up to a file.
Filename: D:\DBSYS\MSSQL\BACKUP\SD70DbR7-Empty-Tlog
When restoring in Enterprise Manager (no matter what
options I choose) I get the infamous message:
The preceding restore operation did not specify WITH
NORECOVERY or WITH STANDBY.
Restart the restore sequence, specifying WITH NORECOVERY
or WITH STANDBY for all but the final step.
I've tried from filegroups and from devices. Specified
backups and specified "Leave DB non-operational
for more Tlog restores"
No joy.
I've tried to use a standalone restore script:
RESTORE LOG SD70DbR7
FROM DISK ='D:\DBSYS\MSSQL\BACKUP\SD70DbR7-Empty-Tlog'
WITH RECOVERY
I get the same message.
I have to specify a file as the TLog is not backed up to a
backup device.
This could be a big mistake on my part
I've specified WITH NORECOVERY and still the same message.
I've said FILE=1 but sill the same message.
When I leave out the very necessary FROM statement I get
teh nice message:
RESTORE LOG successfully processed 0 pages in 0.000
seconds (0.000 MB/sec).
I have some theories as to why I can't restore my TLog but
it seems obscene:
Could the fact that this database has not been backed up
be the issue?
Not on a suitable service pack.
Any suggestions?
Thanks
/SteveYou have to restore the database before you can restore the log. The error
message is saying that you did not do a restore leaving the server in
"norecovery" or "standby" mode so you cannot restore the log. Restore the
database backup and all log backups before that t-log backup using
norecovery and then apply that restore with recovery.
Christian Smith
"Steven Devaney" <Steven.Devaney@.Nospam.thx> wrote in message
news:1281a01c3f646$a327e430$a401280a@.phx.gbl...
> Dear all
> I have a problem restoring a transaction log backup.
> Platform SQL Server 2000 Standard Edition SP 2
> Recovery mode = FULL
> Transaction log backed up when empty to give us a nice
> point to return to after some tests.
> Backup was performed with Enterprise Manager.
> Tlog has been grown from 23Gb to 46Gb after backup to
> accommodate large load of transactions.
> No dump device was created when backing up Tlog. Tlog
> backed up to a file.
> Filename: D:\DBSYS\MSSQL\BACKUP\SD70DbR7-Empty-Tlog
> When restoring in Enterprise Manager (no matter what
> options I choose) I get the infamous message:
> The preceding restore operation did not specify WITH
> NORECOVERY or WITH STANDBY.
> Restart the restore sequence, specifying WITH NORECOVERY
> or WITH STANDBY for all but the final step.
> I've tried from filegroups and from devices. Specified
> backups and specified "Leave DB non-operational
> for more Tlog restores"
> No joy.
> I've tried to use a standalone restore script:
> RESTORE LOG SD70DbR7
> FROM DISK ='D:\DBSYS\MSSQL\BACKUP\SD70DbR7-Empty-Tlog'
> WITH RECOVERY
> I get the same message.
> I have to specify a file as the TLog is not backed up to a
> backup device.
> This could be a big mistake on my part
> I've specified WITH NORECOVERY and still the same message.
> I've said FILE=1 but sill the same message.
> When I leave out the very necessary FROM statement I get
> teh nice message:
> RESTORE LOG successfully processed 0 pages in 0.000
> seconds (0.000 MB/sec).
> I have some theories as to why I can't restore my TLog but
> it seems obscene:
> Could the fact that this database has not been backed up
> be the issue?
> Not on a suitable service pack.
> Any suggestions?
>
> Thanks
> /Steve
>|||Thank you Christian.
As there is no space to do a backup to, I will have to go
for a plan B.
Thanks for the advice - at least it stops me searching for
something that can't be done.
>--Original Message--
>You have to restore the database before you can restore
the log. The error
>message is saying that you did not do a restore leaving
the server in
>"norecovery" or "standby" mode so you cannot restore the
log. Restore the
>database backup and all log backups before that t-log
backup using
>norecovery and then apply that restore with recovery.
>Christian Smith
>"Steven Devaney" <Steven.Devaney@.Nospam.thx> wrote in
message
>news:1281a01c3f646$a327e430$a401280a@.phx.gbl...
>> Dear all
>> I have a problem restoring a transaction log backup.
>> Platform SQL Server 2000 Standard Edition SP 2
>> Recovery mode = FULL
>> Transaction log backed up when empty to give us a nice
>> point to return to after some tests.
>> Backup was performed with Enterprise Manager.
>> Tlog has been grown from 23Gb to 46Gb after backup to
>> accommodate large load of transactions.
>> No dump device was created when backing up Tlog. Tlog
>> backed up to a file.
>> Filename: D:\DBSYS\MSSQL\BACKUP\SD70DbR7-Empty-Tlog
>> When restoring in Enterprise Manager (no matter what
>> options I choose) I get the infamous message:
>> The preceding restore operation did not specify WITH
>> NORECOVERY or WITH STANDBY.
>> Restart the restore sequence, specifying WITH NORECOVERY
>> or WITH STANDBY for all but the final step.
>> I've tried from filegroups and from devices. Specified
>> backups and specified "Leave DB non-operational
>> for more Tlog restores"
>> No joy.
>> I've tried to use a standalone restore script:
>> RESTORE LOG SD70DbR7
>> FROM DISK ='D:\DBSYS\MSSQL\BACKUP\SD70DbR7-Empty-Tlog'
>> WITH RECOVERY
>> I get the same message.
>> I have to specify a file as the TLog is not backed up
to a
>> backup device.
>> This could be a big mistake on my part
>> I've specified WITH NORECOVERY and still the same
message.
>> I've said FILE=1 but sill the same message.
>> When I leave out the very necessary FROM statement I get
>> teh nice message:
>> RESTORE LOG successfully processed 0 pages in 0.000
>> seconds (0.000 MB/sec).
>> I have some theories as to why I can't restore my TLog
but
>> it seems obscene:
>> Could the fact that this database has not been backed up
>> be the issue?
>> Not on a suitable service pack.
>> Any suggestions?
>>
>> Thanks
>> /Steve
>
>.
>

Problem restoring database ...

Dear Newsgroup,

I am using sql server 2000 over win 2000 server with service pack 4.

I have been given a back up of a database (I have tried both from T-SQL and
Enterprise Manager)

T-SQL

RESTORE FILELISTONLY
FROM DISK = 'c:\A.bck'

RESTORE DATABASE B
FROM DISK = 'c:\A.bck'
WITH MOVE 'A_Data' TO 'c:\test\B.mdf',
MOVE 'A_Log' TO 'c:\test\B.ldf'

and as I try to restore I get the following error :

Server: Msg 3154, Level 16, State 2, Line 1
The backup set holds a backup of a database other than the existing 'B'
database.
Server: Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.

Would you kindly help me ?????

Thank you in advance,
YassYass (gol_e_yass@.yahoo.com) writes:
> RESTORE FILELISTONLY
> FROM DISK = 'c:\A.bck'
> RESTORE DATABASE B
> FROM DISK = 'c:\A.bck'
> WITH MOVE 'A_Data' TO 'c:\test\B.mdf',
> MOVE 'A_Log' TO 'c:\test\B.ldf'
> and as I try to restore I get the following error :
> Server: Msg 3154, Level 16, State 2, Line 1
> The backup set holds a backup of a database other than the existing 'B'
> database.
> Server: Msg 3013, Level 16, State 1, Line 1
> RESTORE DATABASE is terminating abnormally.
> Would you kindly help me ?????

I'm out on a limb here, but my interpretation is that there is already
a database B on the machine, but the backup is taken from another
database (A?). Adding ", REPLACE" at the end will get rid of the
error message - and wipe out B, so be careful that this is what you
want to do.

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp

problem restore database SQL2005

Dear all,
I'm trying to restore a database saved last week in a .bak file through the
GUI of Management Studio but i have the following message error : "the
database is in use".
So i restarted the service engine SQL and changed the option to put Single
User but i have still the same error message when trying to restore.
Do you the procedure to restore a database with SQL2005 through the
Management Studio ?
Thanks in advance.
Check the ActivityLog to find out who is connected to database.
Thanks & Rate the Postings.
-Ravi-
"Ving" wrote:

> Dear all,
> I'm trying to restore a database saved last week in a .bak file through the
> GUI of Management Studio but i have the following message error : "the
> database is in use".
> So i restarted the service engine SQL and changed the option to put Single
> User but i have still the same error message when trying to restore.
> Do you the procedure to restore a database with SQL2005 through the
> Management Studio ?
> Thanks in advance.
>
>

problem restore database SQL2005

Dear all,
I'm trying to restore a database saved last week in a .bak file through the
GUI of Management Studio but i have the following message error : "the
database is in use".
So i restarted the service engine SQL and changed the option to put Single
User but i have still the same error message when trying to restore.
Do you the procedure to restore a database with SQL2005 through the
Management Studio ?
Thanks in advance.Check the ActivityLog to find out who is connected to database.
--
Thanks & Rate the Postings.
-Ravi-
"Ving" wrote:
> Dear all,
> I'm trying to restore a database saved last week in a .bak file through the
> GUI of Management Studio but i have the following message error : "the
> database is in use".
> So i restarted the service engine SQL and changed the option to put Single
> User but i have still the same error message when trying to restore.
> Do you the procedure to restore a database with SQL2005 through the
> Management Studio ?
> Thanks in advance.
>
>

problem restore database SQL2005

Dear all,
I'm trying to restore a database saved last week in a .bak file through the
GUI of Management Studio but i have the following message error : "the
database is in use".
So i restarted the service engine SQL and changed the option to put Single
User but i have still the same error message when trying to restore.
Do you the procedure to restore a database with SQL2005 through the
Management Studio ?
Thanks in advance.Check the ActivityLog to find out who is connected to database.
--
Thanks & Rate the Postings.
-Ravi-
"Ving" wrote:

> Dear all,
> I'm trying to restore a database saved last week in a .bak file through th
e
> GUI of Management Studio but i have the following message error : "the
> database is in use".
> So i restarted the service engine SQL and changed the option to put Single
> User but i have still the same error message when trying to restore.
> Do you the procedure to restore a database with SQL2005 through the
> Management Studio ?
> Thanks in advance.
>
>

Wednesday, March 21, 2012

Problem passing columns as parameter!

Dear friens,

I need to pass a column as a parameter in my query. I did this:

ALTER PROCEDURE [dbo].[GD_SP_GET_UsersByDIR_COD]

@.Direccao nvarchar(11),

@.prmFieldName nvarchar(25),

@.prmFieldValue nvarchar(25)

AS

BEGIN

IF @.prmFieldValue='*' OR @.prmFieldValue=''

BEGIN

SELECT TOP (100) PERCENT dbo.ADServico_User.UserID, dbo.ADUser.UserName AS Nome, dbo.HARDWARE.New_Computername AS Computername,

dbo.ModeloPC.MOD_ModeloPC AS ModeloPC, dbo.Monitor.MON_Monitor AS Monitor, dbo.Status.StatusNome AS Status,

dbo.HARDWARE.Migrada AS Interven??o, dbo.HARDWARE.MigraViaChange AS [Migrada via Change], dbo.HARDWARE.StatusID,

dbo.HARDWARE.NS_ID

FROM dbo.ModeloPC INNER JOIN

dbo.SERVICO INNER JOIN

dbo.ADServico_User ON dbo.SERVICO.S_GrupoServico = dbo.ADServico_User.GrupoServico INNER JOIN

dbo.HARDWARE ON dbo.ADServico_User.UserID = dbo.HARDWARE.UserID INNER JOIN

dbo.Status ON dbo.HARDWARE.StatusID = dbo.Status.ID ON dbo.ModeloPC.MODELO_ID = dbo.HARDWARE.MODELO_ID INNER JOIN

dbo.Monitor ON dbo.HARDWARE.MONITOR_ID = dbo.Monitor.MONITOR_ID INNER JOIN

dbo.DIRECCAO ON dbo.SERVICO.S_NomeDir = dbo.DIRECCAO.DIR_COD LEFT OUTER JOIN

dbo.ADUser ON dbo.HARDWARE.UserID = dbo.ADUser.UserID

WHERE (dbo.HARDWARE.StatusID <> 6) AND (dbo.DIRECCAO.DIR_COD = @.Direccao)

ORDER BY Nome

END

ELSE

BEGIN

DECLARE @.SQL varchar(7000)

SET @.Direccao='CGD-DAS'

SET @.prmFieldName='UserID'

SET @.prmFieldValue='C095122'

SET @.SQL = 'SELECT

TOP (100) PERCENT dbo.ADServico_User.UserID, dbo.ADUser.UserName AS Nome, dbo.HARDWARE.New_Computername AS Computername,

dbo.ModeloPC.MOD_ModeloPC AS ModeloPC, dbo.Monitor.MON_Monitor AS Monitor, dbo.Status.StatusNome AS Status,

dbo.HARDWARE.Migrada AS Interven??o, dbo.HARDWARE.MigraViaChange AS [Migrada via Change], dbo.HARDWARE.StatusID,

dbo.HARDWARE.NS_ID

FROM dbo.ModeloPC INNER JOIN

dbo.SERVICO INNER JOIN

dbo.ADServico_User ON dbo.SERVICO.S_GrupoServico = dbo.ADServico_User.GrupoServico INNER JOIN

dbo.HARDWARE ON dbo.ADServico_User.UserID = dbo.HARDWARE.UserID INNER JOIN

dbo.Status ON dbo.HARDWARE.StatusID = dbo.Status.ID ON dbo.ModeloPC.MODELO_ID = dbo.HARDWARE.MODELO_ID INNER JOIN

dbo.Monitor ON dbo.HARDWARE.MONITOR_ID = dbo.Monitor.MONITOR_ID INNER JOIN

dbo.DIRECCAO ON dbo.SERVICO.S_NomeDir = dbo.DIRECCAO.DIR_COD LEFT OUTER JOIN

dbo.ADUser ON dbo.HARDWARE.UserID = dbo.ADUser.UserID

WHERE (dbo.HARDWARE.StatusID <> 6) AND (dbo.DIRECCAO.DIR_COD = @.Direccao)

AND '+ @.prmFieldName +' =' + @.prmFieldValue + ' '

EXEC @.SQL

END

END

THE COMAND EXECUTE SUCESSFULLY IN QUERY ANALISER, BUT IN ASP.NET 2.0 CLIENT RETURNS THE FOLLOWING ERROR:

Server Error in '/WS_GestaoDesktop' Application.


The name 'SELECT
TOP (100) PERCENT dbo.ADServico_User.UserID, dbo.ADUser.UserName AS Nome, dbo.HARDWARE.New_Computername AS Computername,
dbo.ModeloPC.MOD_ModeloPC AS ModeloPC, dbo.Monitor.MON_Monitor AS Monitor, dbo.Status.StatusNome AS Status,
dbo.HARDWARE.Migrada AS Interven??o, dbo.HARDWARE.MigraViaChange AS [Migrada via Change], dbo.HARDWARE.StatusID,
dbo.HARDWARE.NS_ID
FROM dbo.ModeloPC INNER JOIN
dbo.SERVICO INNER JOIN
dbo.ADServico_User ON dbo.SERVICO.S_GrupoServico = dbo.ADServico_User.GrupoServico INNER JOIN
dbo.HARDWARE ON dbo.ADServico_User.UserID = dbo.H' is not a valid identifier.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: The name 'SELECT
TOP (100) PERCENT dbo.ADServico_User.UserID, dbo.ADUser.UserName AS Nome, dbo.HARDWARE.New_Computername AS Computername,
dbo.ModeloPC.MOD_ModeloPC AS ModeloPC, dbo.Monitor.MON_Monitor AS Monitor, dbo.Status.StatusNome AS Status,
dbo.HARDWARE.Migrada AS Interven??o, dbo.HARDWARE.MigraViaChange AS [Migrada via Change], dbo.HARDWARE.StatusID,
dbo.HARDWARE.NS_ID
FROM dbo.ModeloPC INNER JOIN
dbo.SERVICO INNER JOIN
dbo.ADServico_User ON dbo.SERVICO.S_GrupoServico = dbo.ADServico_User.GrupoServico INNER JOIN
dbo.HARDWARE ON dbo.ADServico_User.UserID = dbo.H' is not a valid identifier.

Source Error:

Line 3269: }

Line 3270: dsHardware.dtGD_SP_GET_UsersByDIR_CODDataTable dataTable = new dsHardware.dtGD_SP_GET_UsersByDIR_CODDataTable();

Line 3271: this.Adapter.Fill(dataTable);

Line 3272: return dataTable;

Line 3273: }

The problem is based here:

WHERE (dbo.HARDWARE.StatusID <> 6) AND (dbo.DIRECCAO.DIR_COD = @.Direccao)

if you want to pass a static value use

WHERE (dbo.HARDWARE.StatusID <> 6) AND (dbo.DIRECCAO.DIR_COD = ''' + @.Direccao + ''')

if you want to pass a identifier use

WHERE (dbo.HARDWARE.StatusID <> 6) AND (dbo.DIRECCAO.DIR_COD = ' + @.Direccao + ')

HTh, Jens K. Suessmeyer.

http://www.sqlserver2005.de

|||

Dear Friend,I changed as you told, but the error still there! :-(

CREATE PROCEDURE [dbo].[GD_SP_GET_UsersByDIR_COD]

@.Direccao nvarchar(11),

@.prmFieldName nvarchar(25),

@.prmFieldValue nvarchar(25)

AS

BEGIN

IF @.prmFieldValue='*' OR @.prmFieldValue=''

BEGIN

SELECT TOP (100) PERCENT dbo.ADServico_User.UserID, dbo.ADUser.UserName AS Nome, dbo.HARDWARE.New_Computername AS Computername,

dbo.ModeloPC.MOD_ModeloPC AS ModeloPC, dbo.Monitor.MON_Monitor AS Monitor, dbo.Status.StatusNome AS Status,

dbo.HARDWARE.Migrada AS Interven??o, dbo.HARDWARE.MigraViaChange AS [Migrada via Change], dbo.HARDWARE.StatusID,

dbo.HARDWARE.NS_ID

FROM dbo.ModeloPC INNER JOIN

dbo.SERVICO INNER JOIN

dbo.ADServico_User ON dbo.SERVICO.S_GrupoServico = dbo.ADServico_User.GrupoServico INNER JOIN

dbo.HARDWARE ON dbo.ADServico_User.UserID = dbo.HARDWARE.UserID INNER JOIN

dbo.Status ON dbo.HARDWARE.StatusID = dbo.Status.ID ON dbo.ModeloPC.MODELO_ID = dbo.HARDWARE.MODELO_ID INNER JOIN

dbo.Monitor ON dbo.HARDWARE.MONITOR_ID = dbo.Monitor.MONITOR_ID INNER JOIN

dbo.DIRECCAO ON dbo.SERVICO.S_NomeDir = dbo.DIRECCAO.DIR_COD LEFT OUTER JOIN

dbo.ADUser ON dbo.HARDWARE.UserID = dbo.ADUser.UserID

WHERE (dbo.HARDWARE.StatusID <> 6) AND (dbo.DIRECCAO.DIR_COD = @.Direccao)

ORDER BY Nome

END

ELSE

BEGIN

DECLARE @.SQL varchar(7000)

SET @.Direccao='CGD-DAS'

SET @.prmFieldName='UserID'

SET @.prmFieldValue='C095122'

SET @.SQL = 'SELECT

TOP (100) PERCENT dbo.ADServico_User.UserID, dbo.ADUser.UserName, dbo.HARDWARE.New_Computername,

dbo.ModeloPC.MOD_ModeloPC, dbo.Monitor.MON_Monitor AS Monitor, dbo.Status.StatusNome,

dbo.HARDWARE.Migrada, dbo.HARDWARE.MigraViaChange, dbo.HARDWARE.StatusID,

dbo.HARDWARE.NS_ID

FROM dbo.ModeloPC INNER JOIN

dbo.SERVICO INNER JOIN

dbo.ADServico_User ON dbo.SERVICO.S_GrupoServico = dbo.ADServico_User.GrupoServico INNER JOIN

dbo.HARDWARE ON dbo.ADServico_User.UserID = dbo.HARDWARE.UserID INNER JOIN

dbo.Status ON dbo.HARDWARE.StatusID = dbo.Status.ID ON dbo.ModeloPC.MODELO_ID = dbo.HARDWARE.MODELO_ID INNER JOIN

dbo.Monitor ON dbo.HARDWARE.MONITOR_ID = dbo.Monitor.MONITOR_ID INNER JOIN

dbo.DIRECCAO ON dbo.SERVICO.S_NomeDir = dbo.DIRECCAO.DIR_COD LEFT OUTER JOIN

dbo.ADUser ON dbo.HARDWARE.UserID = dbo.ADUser.UserID

WHERE (dbo.HARDWARE.StatusID <> 6) AND (dbo.DIRECCAO.DIR_COD ='+ @.Direccao +')

AND '+ @.prmFieldName +' =' + @.prmFieldValue + ' '

EXEC @.SQL

END

END

ERROR:

Msg 203, Level 16, State 2, Procedure GD_SP_GET_UsersByDIR_COD, Line 49

The name 'SELECT

TOP (100) PERCENT dbo.ADServico_User.UserID, dbo.ADUser.UserName AS Nome, dbo.HARDWARE.New_Computername AS Computername,

dbo.ModeloPC.MOD_ModeloPC AS ModeloPC, dbo.Monitor.MON_Monitor AS Monitor, dbo.Status.StatusNome AS Status,

dbo.HARDWARE.Migrada AS Interven??o, dbo.HARDWARE.MigraViaChange AS [Migrada via Change], dbo.HARDWARE.StatusID,

dbo.HARDWARE.NS_ID

FROM dbo.ModeloPC INNER JOIN

dbo.SERVICO INNER JOIN

dbo.ADServico_User ON dbo.SERVICO.S_GrupoServico = dbo.ADServico_User.GrupoServico INNER JOIN

dbo.HARDWARE ON dbo.ADServico_User.UserID = dbo.H' is not a valid identifier.

|||

change the following things..

CREATE PROCEDURE [dbo].[GD_SP_GET_UsersByDIR_COD]

@.Direccao nvarchar(11),

@.prmFieldName nvarchar(25),

@.prmFieldValue nvarchar(25)

AS

BEGIN

IF @.prmFieldValue='*' OR @.prmFieldValue=''

BEGIN

SELECT TOP (100) PERCENT dbo.ADServico_User.UserID, dbo.ADUser.UserName AS Nome, dbo.HARDWARE.New_Computername AS Computername,

dbo.ModeloPC.MOD_ModeloPC AS ModeloPC, dbo.Monitor.MON_Monitor AS Monitor, dbo.Status.StatusNome AS Status,

dbo.HARDWARE.Migrada AS Interven??o, dbo.HARDWARE.MigraViaChange AS [Migrada via Change], dbo.HARDWARE.StatusID,

dbo.HARDWARE.NS_ID

FROM dbo.ModeloPC INNER JOIN

dbo.SERVICO INNER JOIN

dbo.ADServico_User ON dbo.SERVICO.S_GrupoServico = dbo.ADServico_User.GrupoServico INNER JOIN

dbo.HARDWARE ON dbo.ADServico_User.UserID = dbo.HARDWARE.UserID INNER JOIN

dbo.Status ON dbo.HARDWARE.StatusID = dbo.Status.ID ON dbo.ModeloPC.MODELO_ID = dbo.HARDWARE.MODELO_ID INNER JOIN

dbo.Monitor ON dbo.HARDWARE.MONITOR_ID = dbo.Monitor.MONITOR_ID INNER JOIN

dbo.DIRECCAO ON dbo.SERVICO.S_NomeDir = dbo.DIRECCAO.DIR_COD LEFT OUTER JOIN

dbo.ADUser ON dbo.HARDWARE.UserID = dbo.ADUser.UserID

WHERE (dbo.HARDWARE.StatusID <> 6) AND (dbo.DIRECCAO.DIR_COD = @.Direccao)

ORDER BY Nome

END

ELSE

BEGIN

DECLARE @.SQL varchar(7000)

SET @.Direccao='CGD-DAS'

SET @.prmFieldName='UserID'

SET @.prmFieldValue='C095122'

SET @.SQL = 'SELECT

TOP (100) PERCENT dbo.ADServico_User.UserID, dbo.ADUser.UserName, dbo.HARDWARE.New_Computername,

dbo.ModeloPC.MOD_ModeloPC, dbo.Monitor.MON_Monitor AS Monitor, dbo.Status.StatusNome,

dbo.HARDWARE.Migrada, dbo.HARDWARE.MigraViaChange, dbo.HARDWARE.StatusID,

dbo.HARDWARE.NS_ID

FROM dbo.ModeloPC INNER JOIN

dbo.SERVICO INNER JOIN

dbo.ADServico_User ON dbo.SERVICO.S_GrupoServico = dbo.ADServico_User.GrupoServico INNER JOIN

dbo.HARDWARE ON dbo.ADServico_User.UserID = dbo.HARDWARE.UserID INNER JOIN

dbo.Status ON dbo.HARDWARE.StatusID = dbo.Status.ID ON dbo.ModeloPC.MODELO_ID = dbo.HARDWARE.MODELO_ID INNER JOIN

dbo.Monitor ON dbo.HARDWARE.MONITOR_ID = dbo.Monitor.MONITOR_ID INNER JOIN

dbo.DIRECCAO ON dbo.SERVICO.S_NomeDir = dbo.DIRECCAO.DIR_COD LEFT OUTER JOIN

dbo.ADUser ON dbo.HARDWARE.UserID = dbo.ADUser.UserID

WHERE (dbo.HARDWARE.StatusID <> 6) AND (dbo.DIRECCAO.DIR_COD ='''+ @.Direccao +''')

AND '+ @.prmFieldName +' =''' + @.prmFieldValue + ''' '

EXEC @.SQL

END

END

|||

Manid,

I changed as you told, but the error still there! :-(

Regards.

|||I guess you are either trying to change another procedure than you are executing or you will have to provide the whole snippet of code via mail or something to make it reproducable.

HTH, Jens K. Suessmeyer.

http://www.sqlserver2005.de|||

Dear Jens,

I created a more simple query, based in the same problem:

CREATE PROCEDURE TEMP

AS

DECLARE @.SQL varchar(8000)

DECLARE @.prmFieldName varchar(20)

DECLARE @.prmFieldValue varchar(20)

SET @.prmFieldName='UserID'

SET @.prmFieldValue='C095122'

SET @.SQL = 'SELECT New_Computername

FROM HARDWARE

WHERE '+ @.prmFieldName +' =''' + @.prmFieldValue + ''' '

EXEC @.SQL

The logical is the some of other queries, but in this one I can't executed it, because returns the following error:

Msg 2812, Level 16, State 62, Procedure TEMP, Line 15

Could not find stored procedure 'SELECT New_Computername

FROM HARDWARE

WHERE UserID ='C095122' '.

(1 row(s) affected)

If you can put this query with column parameter workink good, my problem probably is resolved for the other queries.

Thanks!

|||Sorry and blame on me for not seeing this, you will have to wriite the exec as follows:

EXEC(@.SQL)

HTH, jens K. Suessmeyer.

http://www.sqlserver2005.de|||

Dear friends,

I created a new simple query to try to resolve the problem of passing a column as parameter, using sp_executesql, but still return error. :-(

ALTER PROCEDURE TEMP

@.prmFieldName nvarchar(25),

@.prmFieldValue nvarchar(25)

AS

DECLARE @.SQL varchar(8000)

SET @.prmFieldName='UserID'

SET @.prmFieldValue='C095122'

SET @.SQL = N'SELECT New_Computername

FROM HARDWARE

WHERE '+ @.prmFieldName +' =''' + @.prmFieldValue + ''' '

EXECUTE sp_executesql @.SQL;

ERROR:

Msg 214, Level 16, State 2, Procedure sp_executesql, Line 1

Procedure expects parameter '@.statement' of type 'ntext/nchar/nvarchar'.

|||

Dear Friends,

I found the solution for my problem.

I must use EXECTUTE sp_executesql @.SQL in spite of EXEC @.SQL, and I must use nvarchar(4000) in spite of varchar(8000).

The final Result:

ALTER PROCEDURE [dbo].[GD_SP_GET_UsersByDIR_COD]

@.Direccao nvarchar(11),

@.prmFieldName nvarchar(30),

@.prmFieldValue nvarchar(25)

AS

BEGIN

IF @.prmFieldValue='*' OR @.prmFieldValue=''

BEGIN

SELECT TOP (100) PERCENT dbo.ADServico_User.UserID, dbo.ADUser.UserName AS Nome, dbo.HARDWARE.New_Computername AS Computername,

dbo.ModeloPC.MOD_ModeloPC AS ModeloPC, dbo.Monitor.MON_Monitor AS Monitor, dbo.Status.StatusNome AS Status,

dbo.HARDWARE.Migrada AS Interven??o, dbo.HARDWARE.MigraViaChange AS [Migrada via Change], dbo.HARDWARE.StatusID,

dbo.HARDWARE.NS_ID

FROM dbo.ModeloPC INNER JOIN

dbo.SERVICO INNER JOIN

dbo.ADServico_User ON dbo.SERVICO.S_GrupoServico = dbo.ADServico_User.GrupoServico INNER JOIN

dbo.HARDWARE ON dbo.ADServico_User.UserID = dbo.HARDWARE.UserID INNER JOIN

dbo.Status ON dbo.HARDWARE.StatusID = dbo.Status.ID ON dbo.ModeloPC.MODELO_ID = dbo.HARDWARE.MODELO_ID INNER JOIN

dbo.Monitor ON dbo.HARDWARE.MONITOR_ID = dbo.Monitor.MONITOR_ID INNER JOIN

dbo.DIRECCAO ON dbo.SERVICO.S_NomeDir = dbo.DIRECCAO.DIR_COD LEFT OUTER JOIN

dbo.ADUser ON dbo.HARDWARE.UserID = dbo.ADUser.UserID

WHERE (dbo.HARDWARE.StatusID <> 6) AND (dbo.DIRECCAO.DIR_COD = @.Direccao)

ORDER BY Nome

END

ELSE

BEGIN

DECLARE @.SQL nvarchar(4000)

SET @.SQL = N'SELECT

TOP (100) PERCENT dbo.ADServico_User.UserID, dbo.ADUser.UserName AS Nome, dbo.HARDWARE.New_Computername AS Computername,

dbo.ModeloPC.MOD_ModeloPC AS ModeloPC, dbo.Monitor.MON_Monitor AS Monitor, dbo.Status.StatusNome AS Status,

dbo.HARDWARE.Migrada AS Interven??o, dbo.HARDWARE.MigraViaChange AS [Migrada via Change], dbo.HARDWARE.StatusID,

dbo.HARDWARE.NS_ID

FROM dbo.ModeloPC INNER JOIN

dbo.SERVICO INNER JOIN

dbo.ADServico_User ON dbo.SERVICO.S_GrupoServico = dbo.ADServico_User.GrupoServico INNER JOIN

dbo.HARDWARE ON dbo.ADServico_User.UserID = dbo.HARDWARE.UserID INNER JOIN

dbo.Status ON dbo.HARDWARE.StatusID = dbo.Status.ID ON dbo.ModeloPC.MODELO_ID = dbo.HARDWARE.MODELO_ID INNER JOIN

dbo.Monitor ON dbo.HARDWARE.MONITOR_ID = dbo.Monitor.MONITOR_ID INNER JOIN

dbo.DIRECCAO ON dbo.SERVICO.S_NomeDir = dbo.DIRECCAO.DIR_COD LEFT OUTER JOIN

dbo.ADUser ON dbo.HARDWARE.UserID = dbo.ADUser.UserID

WHERE (dbo.HARDWARE.StatusID <> 6) AND (dbo.DIRECCAO.DIR_COD ='''+ @.Direccao +''')

AND '+ @.prmFieldName +' =''' + @.prmFieldValue + ''' '

EXECUTE sp_executesql @.SQL

END

END

THANKS FOR ALL YOUR IMPORTANT SUPPORT!!!

Problem on Sync Access database

Dear all,

I have a software written in C#, using RDA to sync access database from desktop. But it is tricky that some time during "Pull" data from SQL Server Agent, my PDA tell me "A request to send data to the computer running IIS has failed. For more information, see HRESULT".

This also happening when I try to unplug the ethernet cable from my desktop however the push and pull actions did not required to go through internet.

Here are part of my codes
m_intdb = new SqlCeRemoteDataAccess("http://desk01:1024", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\inttemp.mdb; Jet OLEDB:System Database=C:\\Documents and Settings\\user\\Application Data\\Microsoft\\Access\\System.MDW");

m_intdb.InternetUrl = "http://desk01:1024";
m_intdb.LocalConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\inttemp.mdb; Jet OLEDB:System Database=C:\\Documents and Settings\\user\\Application Data\\Microsoft\\Access\\System.MDW"";
m_intdb.Pull("pulltest", "SELECT * from pullTest", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\inttemp.mdb; Jet OLEDB:System Database=C:\\Documents and Settings\\user\\Application Data\\Microsoft\\Access\\System.MDW", RdaTrackOption.TrackingOff, "Err_PullTest");

and the error message look like
A request to send data to the computer running IIS has failed. For more information, see HRESULT.

Please help me solve this problem

Best Regards
Tony Lam

Hi Tony,

We have see this problem of coonection error on pulling out the network cable. It dosent happen all the time, but sometimes. We are working on this and this would be fixed in RTW. In meanwhile, if you simply restart the PC (with the ethernet cable still pulled out) and try to sync it should work.

About the first problem you mentioned, connection error while pulling (i understading is in this situation, yiu are nit unplugging the ethernet cable), it would help if you could provide some more information.

Thanks

Manish

|||Dear Manish,

Thanks for your reply, here is the step to procedure the first problem
1. start workstation and pocket pc
2. start pocket pc application
(pull and push functions automatically start after in time interval after cradled
try and catch statement place between each pull and push function,
when an error catched, display it on a dataview in report format
)
3. remove ethernet cable from workstation network adapter
4. when push or pull function is called, the problem produced.

and I have make a temporality solution to create a loopback device for this situation. It might help developer when facing same problem, since I am using non-english version of windows, some wordings might not exactly the same with what you can see. So, just get the meaning.

Here steps to create a "loopback device" (For winxp)
1. gocontrol panel
2. click on iconadd new hardware
3. click next until see question on hardware connected to machine, chooseyes
4. selectadd new hardware from the hardware list
5. choose option withi will pick up hardware myself
6. selectnetwork adpater from the hardware list
7. here you see two lists, choosemicrosoft from left list, andmicrosoft loop back adapter from right list and click next to complete the setup.

Best Regards
Tony Lam
|||

Hi Tony,

Thanks for the details. We will look into this

Regards

Manish

Problem on Sync Access database

Dear all,

I have a software written in C#, using RDA to sync access database from desktop. But it is tricky that some time during "Pull" data from SQL Server Agent, my PDA tell me "A request to send data to the computer running IIS has failed. For more information, see HRESULT".

This also happening when I try to unplug the ethernet cable from my desktop however the push and pull actions did not required to go through internet.

Here are part of my codes
m_intdb = new SqlCeRemoteDataAccess("http://desk01:1024", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\inttemp.mdb; Jet OLEDB:System Database=C:\\Documents and Settings\\user\\Application Data\\Microsoft\\Access\\System.MDW");

m_intdb.InternetUrl = "http://desk01:1024";
m_intdb.LocalConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\inttemp.mdb; Jet

OLEDB:System Database=C:\\Documents and Settings\\user\\Application

Data\\Microsoft\\Access\\System.MDW"";
m_intdb.Pull("pulltest", "SELECT * from pullTest", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\inttemp.mdb; Jet

OLEDB:System Database=C:\\Documents and Settings\\user\\Application

Data\\Microsoft\\Access\\System.MDW", RdaTrackOption.TrackingOff, "Err_PullTest");

and the error message look like
A request to send data to the computer running IIS has failed. For more information, see HRESULT.

Please help me solve this problem

Best Regards
Tony Lam

Hi Tony,

We have see this problem of coonection error on pulling out the network cable. It dosent happen all the time, but sometimes. We are working on this and this would be fixed in RTW. In meanwhile, if you simply restart the PC (with the ethernet cable still pulled out) and try to sync it should work.

About the first problem you mentioned, connection error while pulling (i understading is in this situation, yiu are nit unplugging the ethernet cable), it would help if you could provide some more information.

Thanks

Manish

|||Dear Manish,

Thanks for your reply, here is the step to procedure the first problem
1. start workstation and pocket pc
2. start pocket pc application
(pull and push functions automatically start after in time interval after cradled
try and catch statement place between each pull and push function,
when an error catched, display it on a dataview in report format
)
3. remove ethernet cable from workstation network adapter
4. when push or pull function is called, the problem produced.

and I have make a temporality solution to create a loopback device for this situation. It might help developer when facing same problem, since I am using non-english version of windows, some wordings might not exactly the same with what you can see. So, just get the meaning.

Here steps to create a "loopback device" (For winxp)
1. go control panel
2. click on icon add new hardware
3. click next until see question on hardware connected to machine, choose yes
4. select add new hardware from the hardware list
5. choose option with i will pick up hardware myself
6. select network adpater from the hardware list
7. here you see two lists, choose microsoft from left list, and microsoft loop back adapter from right list and click next to complete the setup.

Best Regards
Tony Lam|||

Hi Tony,

Thanks for the details. We will look into this

Regards

Manish

Tuesday, March 20, 2012

Problem on Sync Access database

Dear all,

I have a software written in C#, using RDA to sync access database from desktop. But it is tricky that some time during "Pull" data from SQL Server Agent, my PDA tell me "A request to send data to the computer running IIS has failed. For more information, see HRESULT".

This also happening when I try to unplug the ethernet cable from my desktop however the push and pull actions did not required to go through internet.

Here are part of my codes
m_intdb = new SqlCeRemoteDataAccess("http://desk01:1024", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\inttemp.mdb; Jet OLEDB:System Database=C:\\Documents and Settings\\user\\Application Data\\Microsoft\\Access\\System.MDW");

m_intdb.InternetUrl = "http://desk01:1024";
m_intdb.LocalConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\inttemp.mdb; Jet

OLEDB:System Database=C:\\Documents and Settings\\user\\Application

Data\\Microsoft\\Access\\System.MDW"";
m_intdb.Pull("pulltest", "SELECT * from pullTest", "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\inttemp.mdb; Jet

OLEDB:System Database=C:\\Documents and Settings\\user\\Application

Data\\Microsoft\\Access\\System.MDW", RdaTrackOption.TrackingOff, "Err_PullTest");

and the error message look like
A request to send data to the computer running IIS has failed. For more information, see HRESULT.

Please help me solve this problem

Best Regards
Tony Lam

Hi Tony,

We have see this problem of coonection error on pulling out the network cable. It dosent happen all the time, but sometimes. We are working on this and this would be fixed in RTW. In meanwhile, if you simply restart the PC (with the ethernet cable still pulled out) and try to sync it should work.

About the first problem you mentioned, connection error while pulling (i understading is in this situation, yiu are nit unplugging the ethernet cable), it would help if you could provide some more information.

Thanks

Manish

|||Dear Manish,

Thanks for your reply, here is the step to procedure the first problem
1. start workstation and pocket pc
2. start pocket pc application
(pull and push functions automatically start after in time interval after cradled
try and catch statement place between each pull and push function,
when an error catched, display it on a dataview in report format
)
3. remove ethernet cable from workstation network adapter
4. when push or pull function is called, the problem produced.

and I have make a temporality solution to create a loopback device for this situation. It might help developer when facing same problem, since I am using non-english version of windows, some wordings might not exactly the same with what you can see. So, just get the meaning.

Here steps to create a "loopback device" (For winxp)
1. go control panel
2. click on icon add new hardware
3. click next until see question on hardware connected to machine, choose yes
4. select add new hardware from the hardware list
5. choose option with i will pick up hardware myself
6. select network adpater from the hardware list
7. here you see two lists, choose microsoft from left list, and microsoft loop back adapter from right list and click next to complete the setup.

Best Regards
Tony Lam|||

Hi Tony,

Thanks for the details. We will look into this

Regards

Manish

Monday, March 12, 2012

Problem of MS SQL -ntwdblib.lib NOT found

Dear all,

I want to use C program to connect MS SQL server.
I copied some sample file to install on my computer.
When I run the program, an error occurred, which is about ntwdblib.dll
not find in some paths.
But when I check the paths again, they have ntwdblib.dll.
When I run my C program in another computer, it works...

so , I feel very frustrated.

In my C program, I include the following libraries.
#defineDBNTWIN32
#include "windows.h"
#include <sqlfront.h>
#include <sqldb.h>
#include <stdio.h
Also, I don't know the meaning of "#defineDBNTWIN32".
I haven't installed SQL Client on my computer. Is it the main
problem??

Pls help!!

Cheers,
Alanalan (cheung_yuklun@.i-cable.com) writes:
> I want to use C program to connect MS SQL server.
> I copied some sample file to install on my computer.
> When I run the program, an error occurred, which is about ntwdblib.dll
> not find in some paths.
> But when I check the paths again, they have ntwdblib.dll.
> When I run my C program in another computer, it works...
> so , I feel very frustrated.
> In my C program, I include the following libraries.
> #define DBNTWIN32
> #include "windows.h"
> #include <sqlfront.h>
> #include <sqldb.h>
> #include <stdio.h>
> Also, I don't know the meaning of "#define DBNTWIN32".
> I haven't installed SQL Client on my computer. Is it the main
> problem??

Yes, that is the problem. NTWDBLIB.DLL is the DLL for DB-Library, which
is not part of MDAC, so SQL connectivity is about the only way to install
it.

DB-Library is a very good client library, but unfortunately Microsoft
does not agree, so they stopped developmet of DB-Lib many years ago.
As a consequence, you have restricted support for new features in
SQL Server with DB-Library.

Unless you have some legacy software you are working with, I'd recommend
you to use ODBC or OLE DB instead.

--
Erland Sommarskog, SQL Server MVP, sommar@.algonet.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp