ado sqlserver Á¬½Ó×Ö·û´®Ôõôд - VC/MFC / Êý¾Ý¿â
±ÉÈËÓÃsql2005½¨ÁËÒ»¸öÊý¾Ý¿ânote.mdf,±íÃûTable£¬ÓÃwindowsÉí·ÝÑéÖ¤ ûÓÐÊäÓû§ÃûºÍÃÜÂë
ÇëÎÊÔÚvc2005ÀïµÄÁ¬½Ó×Ö·û´®Ôõôд
_ConnectionPtr pMyConnect=NULL;
HRESULT hr = pMyConnect.CreateInstance(__uuidof(Connection)));
if( FAILED(hr) ) return;
_bstr_t strConnect="Provider=SQLOLEDB; Server=lenove123;"
"Database=note.mdf; uid=; pwd=;"; //ÕâÀïµÄlenove123ÊDZ¾»úÃû£¬uid pwdÔõôд
try{pMyConnect->Open(strConnect,"","",NULL);}
End_rbody_64855051//-->
¸Ã»Ø¸´ÓÚ2010-04-24 08:35:36±»¹ÜÀíԱɾ³ý
¶ÔÎÒÓÐÓÃ[0]
¶ª¸ö°åש[0]
ÒýÓÃ
¾Ù±¨
¹ÜÀí
TOP
wolflee11
(wolflee11)
µÈ¡¡¼¶£º
#2Â¥ µÃ·Ö£º0»Ø¸´ÓÚ£º2010-04-21 17:13:17
_ConnectionPtr pMyConnect=NULL;
HRESULT hr = pMyConnect.CreateInstance(__uuidof(Connection)));
if( FAILED(hr) ) return;
_bstr_t strConnect="Provider=SQLOLEDB; Server=lenove123;"
"Database=note.mdf; uid=sa; pwd=sa;"; //ÕâÀïµÄlenove123ÊDZ¾»úÃû£¬uid pwd·Ö±ðΪsa
try{pMyConnect->Open(strConnect,"","",NULL);}
µ½ÕâÀﵯ³ö¸ö¡¾DBNETLIB¡¿[ConnectionOpen(Connect()).]SQL Server ²»´æÔÚ»ò¾Ü¾ø·ÃÎÊ
C/C++ code:
try
{
pConn->ConnectionString="Provider=Microsoft.ACE.OLEDB.12.0;\
D
Ïà¹ØÎÊ´ð£º
ÓÐÈËÊÔ¹ýÔÚwin7ÉÏ°²×°sqlserverÂð£¿
Ìý˵sql2000×°²»ÉÏÈ¥£¬²»ÖªµÀÆäËû°æ±¾Ðв»ÐС£
ºÃÏñ²»ÐÐ,²»¼æÈÝ,ÉÏ´ÎÒ²ÓÐÈËÎʹýѽ
ºÇºÇ£¬ÓÐÍøÓÑÓÐÏà¹ØµÄ¾ÑéÂð£¿
Õâ¸ösqlserverÒª¾¡Á¿×°ÔÚwin7ÉÏ¡£
SQLSERVER 2000Ã ......
sqlserver2005 ½¨Á¢µÄÊý¾Ý¿â£¬ÓëÊÖ³Öpda´«ÊäÊý¾Ý£¬×î½üͻȻ³öÏÖÎÞ·¨´«µÝÊý¾ÝµÄÎÊÌ⣬pda¶ËÌáʾµÄ´íÎóʱoutofmemoryexception£¬µ«ÊÇpdaÉÏÃæµÄÈÝÁ¿Ã»ÓÐÎÊÌ⣬
sqlserverµÄÈÕ×ÓÉϵĴíÎóÈçÏ£º
ÈÕÆÚ 2010-1-25 14:45: ......
ÒÔÏ´úÂëÊÇÌí¼ÓÊý¾Ý°´Å¥µÄ´úÂ룬Ïë°Ñtestid£¬ºÍtestnameÁ½¸ötxt´«µÝµ½Êý¾Ý¿âÖÐ
Êý¾Ý¿âÁ¬½Ó¿Ï¶¨Ã»ÎÊÌâ
¾ÍÊǺìÉ«²¿·ÖÀϱ¨´í
²»ÖªµÀΪʲô-£¬-
Çë¸÷λ¸ßÈË°ïæ¿´¿´£¡
лл£¡
Java code:
private void new ......
jspÍùsqlserver2000Àï²åÈëÖÐÎÄʱ£¬×ÜÊÇÂÒÂ룬Ôõô½â¾ö°¡£¿
SQL code:
insert tb(col) values(N'ÖÐÎÄ')
²åÈëʱÔÚÖÐÎÄ×Ö·ûÇ°¼Ó¸ö´óдµÄN
²»ÐÐѽ£¬String sql="insert into news values(N'+title+"' ......
±¾ÈËÍü¼ÇÁËsaµÄÃÜÂë¡£
ÔÚ¡°°²È«ÐÔ¡±¡ú¡°µÇ¼¡±¡ú¡°saÊôÐÔ¡±¸ü¸ÄÃÜÂëÖ®ºó,ÔÚÖØеǽ¡£
µÇ¼ʧ°Ü¡£
ÓÃwindowsÓû§µÇ½
´úÂë¸ü¸Ä£ºsp_password Null,'123456','sa' »¹ÊÇ
µÇ¼ʧ°Ü¡£
ÔÚ¡°·þÎñ¡±¡ú¡°ÊôÐÔ¡±¡ú¡°µ ......