Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

SQLDMOÔÚVBÖеÄÓ¦ÓÃ

¡¡¡¡SQLDMO£¨SQL Distributed Management Objects£¬SQL·Ö²¼Ê½¹ÜÀí¶ÔÏ󣩷â×° Microsoft SQL Server 2000 Êý¾Ý¿âÖеĶÔÏó¡£SQL-DMO ÔÊÐíÓÃÖ§³Ö×Ô¶¯»¯»ò COM µÄÓïÑÔ±àдӦÓóÌÐò£¬ÒÔ¹ÜÀí SQL Server °²×°µÄËùÓв¿·Ö¡£ SQL-DMO ÊÇ SQL Server 2000 ÖÐµÄ SQL Server ÆóÒµ¹ÜÀíÆ÷ËùʹÓõÄÓ¦ÓóÌÐò½Ó¿Ú (API);Òò´ËʹÓà SQL-DMO µÄÓ¦ÓóÌÐò¿ÉÒÔÖ´ÐÐ SQL Server ÆóÒµ¹ÜÀíÆ÷Ö´ÐеÄËùÓй¦ÄÜ¡£
¡¡¡¡SQL-DMO ÓÃÓÚ±ØÐë°üº¬ SQL Server ¹ÜÀíµÄÈκÎ×Ô¶¯»¯»ò COM Ó¦ÓóÌÐò£¬ÀýÈ磺
¡¡¡¡1. ·â×° SQL Server ×÷Ϊ×Ô¼ºµÄÊý¾Ý´æ´¢²¢Ï뾡Á¿¼õÉÙÓû§µÄ SQL Server ¹ÜÀíÈÎÎñµÄÓ¦ÓóÌÐò¡£
¡¡¡¡2. ÔÚ³ÌÐò±¾Éí²¢ÈëÁËרÃŵĹÜÀíÂß¼­µÄÓ¦ÓóÌÐò¡£
¡¡¡¡3. ÏëÔÚ×Ô¼ºµÄÓû§½çÃæÖм¯³É SQL Server ¹ÜÀíÈÎÎñµÄÓ¦ÓóÌÐò¡£
¡¡¡¡SQLDMO¶ÔÏóÀ´×ÔSQLDMO.dll£¬SQLDMO.dllÊÇËæSQL Server2000Ò»Æð·¢²¼µÄ¡£SQLDMO.dll×ÔÉíÊÇÒ»¸öCOM¶ÔÏó£¬Òò´Ë£¬ÔÚÄãµÄ.NETÏîÄ¿Àï±ØÐëÏÈÒýÓÃËü¡£
¡¡¡¡µÃµ½ÍøÂçÖеÄSQL·þÎñÆ÷µÄÁÐ±í£º
'µÃµ½SQL·þÎñÆ÷µÄÁбí
'±ØÐë°²×°SQL SERVER 2000 SP2 ¼°ÒÔÉÏ°æ±¾
Dim I As Short
Dim sqlApp As New SQLDMO.Application()
Dim ServerName As SQLDMO.NameList
ServerName = sqlApp.ListAvailableSQLServers
For i = 1 To ServerName.Count
cbServer.Items.Add(ServerName.Item(i))
Next
¡¡¡¡µÃµ½Ö¸¶¨SQL·þÎñÆ÷ËùÓÐÊý¾Ý¿âµÄÁÐ±í£º
'µÃµ½Ö¸¶¨SQL·þÎñÆ÷ËùÓÐÊý¾Ý¿âµÄÁбí
Dim sqlApp As New SQLDMO.Application()
Dim oServer As New SQLDMO.SQLServer()
oServer.Connect("(local)", "sa", "sa")
cboDatabase.Items.Clear()
Dim db As SQLDMO.Database
For Each db In oServer.Databases
Me.cboDatabase.Items.Add(db.Name)
Next
¡¡¡¡µÃµ½ËùÓÐµÄ±í¡¢ÊÓͼ¡¢´æ´¢¹ý³Ì£º
Dim I As Short
Dim oServer As New SQLDMO.SQLServer()
oServer.Connect("(local)", "sa", "sa")
Dim db As New SQLDMO.Database()
For I = 1 To oServer.Databases.Count
If oServer.Databases.Item(I, "dbo").Name = "Northwind" Then Exit For
Next
If I > oServer.Databases.Count Then Exit Sub
db = oServer.Databases.Item(I, "dbo")
ListBox1.Items.Clear()
'µÃµ½ËùÓеĴ洢¹ý³Ì
For I = 1 To db.StoredProcedures.Count
ListBox1.Items.Add(db.StoredProcedures.Item(I, "dbo").Name)
Next
'µÃµ½ËùÓеıí
For I = 1 To db.Tables.Count
ListBox1.Items.Add


Ïà¹ØÎĵµ£º

vbÔÚµ÷ÓÃAPIµÄÒ»¸öBug¿ÉÄܵ¼ÖÂÄÚ´æй¶

ÆäʵÕâ¸öÎÊÌâÎÒºÜÔçºÜÔçÒÔÇ°¾Í·¢ÏÖÁË£¬Ö»ÊÇһֱûÁôÒ⣬Ҳ²»ÔÚÒâ¡£½ñÌìÎÞÒâÖÐÓÖÓÃVBдÁËÒ»¸ö³ÌÐòÈ«²¿Ê¹ÓÃNTDLLµ¼³öº¯Êý±àд£¬ÓÖ³öÏÖÁËÕâÑùµÄÇé¿ö£¬ÕâÑù¾ÍÓɲ»µÃÎÒ²»×¢ÒâÁË£¬¾­¹ýÎҵķ´¸´²âÊÔÒÔ¼°·´»ã±àÑéÖ¤£¬Ö¤ÊµÁËvb6_sp6ÔÚµ÷ÓÃijЩAPI(²âÊÔµÄÓ¦¸ÃÓкܶàAPI´æÔÚÕâÑùµÄÎÊÌâ)´æÔÚÄÚ´æй¶ÎÊÌâ»òÕßÊǺ¯Êýµ÷ÓÃʧ°Ü¡£Çë´ó¼ÒÏÈ¿´ ......

VCʵÏÖÀàËÆVBÖеÄLinkLabel¹¦ÄÜ

VCʵÏÖÀàËÆVBÖеÄLinkLabel¹¦ÄÜ
 
 //VBÀïÃæÓиöLinkLabel£¬VBÖеÄLabelÔÚVCÖÐʽCStatic£¬µ«ÊÇVCÖÐCStaticûÓÐÀàËÆLinkLabelµÄ¹¦ÄÜ¡£¿ÉÒÔ×Ô¼º
//Ìí¼ÓÒ»µã´úÂëÀ´ÊµÏÖ£º
//²»ÖªµÀΪʲôIDC_HANDDÒ»¶¨Òª×Ô¼º¶¨ÒåÒ»ÏÂ
#define IDC_HAND MAKEINTRESOURCE(32649)
//´¦ÀíÊó±êÒƶ¯
void CAppNonameDlg::OnMouseMov ......

VBº¯Êý¶¨Òå

Ãû³Æ ÀàÐÍ ËµÃ÷
abort º¯Êý ÒýÆð·ÅÆúµÄÒâÍâ´¦Àí
abs º¯Êý ¾ø¶ÔÖµº¯Êý
addexitproc º¯Êý ½«Ò»¹ý³ÌÌí¼Óµ½ÔËÐÐʱ¿âµÄ½áÊø¹ý³Ì±íÖÐ
addr º¯Êý ·µ»ØÖ¸¶¨¶ÔÏóµÄµØÖ·
adjustlinebreaks º¯Êý ½«¸ø¶¨×Ö·û´®µÄÐзָô·ûµ÷ÕûΪcr/lfÐòÁÐ
align ÊôÐÔ Ê¹¿Ø¼þλÓÚ´°¿Úij²¿·Ö
alignment ÊôÐÔ ¿Ø¼þ±êÇ©µÄÎÄ×ÖλÖÃ
allocmem º ......

vb µ÷ÓÃdelphiдµÄdll

delphiÖеÄDLLÖеÄÉùÃ÷Ô­ÂëÈçÏ£º
ÕâÀïÉùÃ÷ÁËÊä³öÐÔ²ÎÊý·Ö±ðΪÊý×ÖÓë×Ö·ûÀàÐÍ
library dll1;
uses
  SysUtils,
  Classes;
{$R *.res}
Function mymax(x, y: Integer; out jj: Integer; out abc: PChar): Integer; stdcall;
begin
  jj := x * y;
  abc := PChar(StrPas(abc) + 'ÕâÊÇ´«³öµÄ' ......

VBÔËÐÐDOSÃüÁîÉú³ÉÎı¾Îļþ²¢´ò¿ª´¦ÀíµÄÎÊÌâ

ÎÒÓÃVBÖ´ÐÐDOSÃüÁÉú³ÉÎı¾ÎļþËæ¼´´ò¿ª
µ«ÊÇÓÉÓÚÎı¾ÎļþÉú³ÉÐèÒªÒ»¶Îʱ¼ä£¬
»¹Î´µÈÎļþÉú³ÉÍê±ÏVB¾Í´ò¿ªÁËÕâ¸öÎļþ
ÇëÎÊÈçºÎÈóÌÐòµÈ´ýDOSÃüÁîÖ´ÐÐÍê±ÏÔÙ´ò¿ªÕâ¸öÎı¾Îļþ°¡
×îºÃ»¹ÄܼÓÉÏÒ»¸öµÈ´ýµÄ½ø¶ÈÌõÏÔʾÎı¾ÎļþµÄÉú³É¹ý³Ì
´úÂëÈçÏ£º
Shell "cmd  /c dir /s /b e:\ dir.txt"
Open "dir.txt" ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ