显示标签为“visual”的博文。显示所有博文
显示标签为“visual”的博文。显示所有博文

2012年3月27日星期二

BCP with ODBC Native driver

We are using Visual Studio 2003 to develop a VC++ application to support SQL Server 2000 and 2005 through ODBC driver. I was able to successfully test the application with ODBC driver for 2000. But when it comes to the SQL Server 2005 using native ODBC driver it fails with "ODBCBCP.dll is not compatible with 'SQL Native Client' driver. Please configure 'SQL Server' driver for the DSN or connection string.

Then I tried to use the sqlncli.h inplace of odbcss.h and replaced the odbcbcp.lib with sqlncli.lib pointing to the C:\Program Files\Microsoft SQL Server\90\SDK\Lib\x86 folder.

Code Snippet

#include <sql.h>

#include <sqlext.h>

#include <sqltypes.h>

#define _SQLNCLI_ODBC_

#include <sqlncli.h>

Now I can not compile the program. The errors I am getting are as follows:

c:\Program Files\Microsoft SQL Server\90\SDK\Include\sqlncli.h(2894): error C2061: syntax error : identifier 'DB_UPARAMS'

c:\Program Files\Microsoft SQL Server\90\SDK\Include\sqlncli.h(2901): error C2061: syntax error : identifier 'DB_UPARAMS'
etc

c:\Program Files\Microsoft SQL Server\90\SDK\Include\sqlncli.h(2938): error C2061: syntax error : identifier 'HCHAPTER'
c:\Program Files\Microsoft SQL Server\90\SDK\Include\sqlncli.h(2944): error C2061: syntax error : identifier 'HCHAPTER'
etc

The same code just works fine in the Visual Studio 2005, but we need the dll in Visual studio 2003.

I think I am missing pretty obvious. Your help is appreciated.

Can you try not defining _SQLNCLI_ODBC_, I believe that would work.

Thanks

Waseem

sql

2012年2月18日星期六

bcp

How implements bcp.exe in visual basic.net project.
hi Viktor,
"Viktor Zadro" <viktor.zadro@.tel.net.ba> ha scritto nel messaggio
news:O1IHIcPtEHA.2192@.TK2MSFTNGP14.phx.gbl
> How implements bcp.exe in visual basic.net project.
how would you implement BCP?
you can "shell" to it, or you could "import" the COM object definition of
bcp (via INTEROP) and access it's properties and methods...
http://msdn.microsoft.com/library/de..._ob_b_8o8k.asp
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.9.1 - DbaMgr ver 0.55.1
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply

2012年2月11日星期六

Basics

Hi there,

I've recently bought Visual Studio 2005, and I got SQL server 2005. I have no idea how to work it. I can't even find where you make a table.

Any basic help about SQL server 2005 is needed.

Thanks,
AliQ

Hello AliQ,

SQL Server Books Online has all the information you need, including tutorials and the like. Perhaps do a google on "SQL Server tutorial".

Cheers,
Rob

|||

Hi AliQ:

To find books online from machines you have installed SQL Server 2005, go to Start -> Programs -> Microsoft SQL Server 2005 -> Documentation and Tutorials -> SQL Server Books On Line.

To start using SQL Server, Launch Microsoft SQL Server Management Studio by:

Start -> Programs -> Microsoft SQL Server 2005 -> SQL Server Management Studio.

When launched, if "Server name:" field is empty, please try to enter one of the following:

1. your computer name. or

2. (local)

and click "Connect" buttom.

Once when you connected to Database engine, you can create database, table, management database security..etc from here.

To learn more about SQL Server 2005, I'd recommand the following reference from MSDN.

http://msdn2.microsoft.com/en-us/library/ms950403.aspx

Hope this helps. :-)

Thanks.