亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? 在vb中用程序建立dsn數(shù)據(jù)源.txt

?? VB技巧問(wèn)答10000例,是一個(gè)教程
?? TXT
字號(hào):

    SUMMARY 
    ======= 
     
    In the 32-bit version of Visual Basic 4.0, it is possible to use DSN-less connections, but because the 16-bit version of ODBC can not handle this syntax, it is not possible to do this in the 16-bit version of Visual Basic 4.0. It ispossible to emulate this ability by dynamically creating and removing a Data Source Name (DSN) on the fly using the SQLConfigDataSource ODBC API call. 
     
    The following is a 16-and 32-bit example that demonstrates this technique. The 32-bit code was included because this technique has other uses as described below. The 32-bit techniques presented in this article also apply to Visual Basic 5.0. 
     
    MORE INFORMATION 
    ================ 
     
    The 32-bit ODBC ability to use a DSN-less connection has many uses: 
     
    1. Client Simplicity. The user does not have to worry about setting up a DSN, naming it correctly, setting up options, etc. All this can be done dynamically by the application. 
     
    2. It solves many JET engine connection and connect string caching issues. 
     
    3. Increases the flexibility of the application. 
     
    All of these uses can be realized in 16-bit ODBC by creating and deleting a DSN 
    on the fly. This method is also useful for simple DSN management. The code could 
    be used to automatically create, modify, or delete a DSN at any time. Visual Basic does provide the ability to create a DSN using the DBEngine.RegisterDatabase() method, but the API provides greater functionality and the ability to modify and remove a DSN, as well. 
     
    Step-by-Step Example 
    -------------------- 
     
    1. Start a New Project. 
     
    2. In the Advanced tab of the Options dialog box under the Tools menu, set a Conditional Compilation Argument named WIN32 equal to 1 if using Visual Basic 
     4.0 32-bit, or 0 if using Visual Basic 4.0 16-bit. 
     
    3. Add two CommandButtons to the default form. 
     
    4. Add the following code to the General Declarations: 
     
     Option Explicit 
     
     'Constant Declaration 
     Private Const ODBC_ADD_DSN = 1 ' Add data source 
     Private Const ODBC_CONFIG_DSN = 2 ' Configure (edit) data source 
     Private Const ODBC_REMOVE_DSN = 3 ' Remove data source 
     Private Const vbAPINull As Long = 0& ' NULL Pointer 
     
     'Function Declare 
     #If WIN32 Then 
     
     Private Declare Function SQLConfigDataSource Lib "ODBCCP32.DLL" _ 
     (ByVal hwndParent As Long, ByVal fRequest As Long, _ 
     ByVal lpszDriver As String, ByVal lpszAttributes As String) _ 
     As Long 
     #Else 
     Private Declare Function SQLConfigDataSource Lib "ODBCINST.DLL" _ 
     (ByVal hwndParent As Integer, ByVal fRequest As Integer, ByVal _ 
     lpszDriver As String, ByVal lpszAttributes As String) As Integer 
     #End If 
     
    5. Add the following code into the Click event of Command1: 
     
     #If WIN32 Then 
     Dim intRet As Long 
     #Else 
     Dim intRet As Integer 
     #End If 
     Dim strDriver As String 
     Dim strAttributes As String 
     
     'Set the driver to SQL Server because it is most common. 
     strDriver = "SQL Server" 
     'Set the attributes delimited by null. 
     'See driver documentation for a complete 
     'list of supported attributes. 
     strAttributes = "SERVER=SomeServer" & Chr$(0) 
     strAttributes = strAttributes & "DESCRIPTION=Temp DSN" & Chr$(0) 
     strAttributes = strAttributes & "DSN=DSN_TEMP" & Chr$(0) 
     strAttributes = strAttributes & "DATABASE=pubs" & Chr$(0) 
     strAttributes = strAttributes & "UID=sa" & Chr$(0) 
     strAttributes = strAttributes & "PWD=" & Chr$(0) 
     'To show dialog, use Form1.Hwnd instead of vbAPINull. 
     intRet = SQLConfigDataSource(vbAPINull, ODBC_ADD_DSN, _ 
     strDriver, strAttributes) 
     If intRet Then 
     MsgBox "DSN Created" 
     Else 
     MsgBox "Create Failed" 
     End If 
     
    6. Add the following code into the Click event of Command2: 
     
     #If WIN32 Then 
     Dim intRet As Long 
     #Else 
     Dim intRet As Integer 
     #End If 
     Dim strDriver As String 
     Dim strAttributes As String 
     
     'Set the driver to SQL Server because most common. 
     strDriver = "SQL Server" 
     'Set the attributes delimited by null. 
     'See driver documentation for a complete list of attributes. 
     strAttributes = "DSN=DSN_TEMP" & Chr$(0) 
     'To show dialog, use Form1.Hwnd instead of vbAPINull. 
     intRet = SQLConfigDataSource(vbAPINull, ODBC_REMOVE_DSN, _ 
     strDriver, strAttributes) 
     If intRet Then 
     MsgBox "DSN Deleted" 
     Else 
     MsgBox "Delete Failed" 
     End If 
     
    7. Run the project. 
     
    8. Click Command1 to add a DSN named DSN_TEMP. 
     
    9. Click Command2 to remove the DSN named DSN_TEMP. 
     

    SUMMARY 
    ======= 
     
    This article demonstrates how to programmatically create a Data Source Name (DSN) for SQL Server using Visual Basic. The technique discussed in this article uses Windows Application Programming Interface (API) functions to create and manipulate entries in the Windows Registry. 
     
    MORE INFORMATION 
    ================ 
     
    DSNs are usually created through the ODBC Data Source Administrator 
    window, which is accessible from the Windows Control Panel. Other 
    techniques that provide access to ODBC-compliant databases include using RegisterDatabase (a Data Access Object (DAO) method), using the SQLConfigDataSource ODBC API function, or using a DSN-less connection 
    string. 
     
    However, it is possible to establish a new DSN by manually creating and manipulating values in the Windows Registry. The following technique uses the RegCreateKey, RegSetValueEx, and RegCloseKey API functions to create a system DSN for a SQL Server database. 
     
    Step-by-Step Procedures 
    ----------------------- 
     
    1. Open a new Visual Basic project. Form1 is created by default. Put a CommandButton on Form1 (Command1), and put the following code in the General Declarations section of the code for Form1: 
     Option Explicit 
     
     Private Const REG_SZ = 1 'Constant for a string variable type. 
     Private Const HKEY_LOCAL_MACHINE = &H80000002 
     
     Private Declare Function RegCreateKey Lib "advapi32.dll" Alias _ 
     "RegCreateKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, _ 
     phkResult As Long) As Long 
     
     Private Declare Function RegSetValueEx Lib "advapi32.dll" Alias _ 
     "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, _ 
     ByVal Reserved As Long, ByVal dwType As Long, lpData As Any, ByVal _ 
     cbData As Long) As Long 
     
     Private Declare Function RegCloseKey Lib "advapi32.dll" _ 
     (ByVal hKey As Long) As Long 
     
    2. Place the following code in the click event of the Command1 button on Form1: 
     
     Change the values of the DataSourceName, DatabaseName, Description, DriverPath, LastUser, and Server variables as appropriate for your environment. Any of the drivers listed on the ODBC Drivers tab of the ODBC Data Source Administrator window can be used as part of the DriverPath variable. All of these drivers can be found in C:\Windows\System for Windows 95 or Windows 98 machines and C:\Winnt\System32 for Windows NT. 
     
     Private Sub Command1_Click() 
     
     Dim DataSourceName As String 
     Dim DatabaseName As String 
     Dim Description As String 
     Dim DriverPath As String 
     Dim DriverName As String 
     Dim LastUser As String 
     Dim Regional As String 
     Dim Server As String 
     
     Dim lResult As Long 
     Dim hKeyHandle As Long 
     
     'Specify the DSN parameters. 
     
     DataSourceName = "" 
     DatabaseName = "" 
     Description = "" 
     DriverPath = "" 
     LastUser = "" 
     Server = "" 
     DriverName = "SQL Server" 
     
     'Create the new DSN key. 
     
     lResult = RegCreateKey(HKEY_LOCAL_MACHINE, "SOFTWARE\ODBC\ODBC.INI\" & _ 
     DataSourceName, hKeyHandle) 
     
     'Set the values of the new DSN key. 
     
     lResult = RegSetValueEx(hKeyHandle, "Database", 0&, REG_SZ, _ 
     ByVal DatabaseName, Len(DatabaseName)) 
     lResult = RegSetValueEx(hKeyHandle, "Description", 0&, REG_SZ, _ 
     ByVal Description, Len(Description)) 
     lResult = RegSetValueEx(hKeyHandle, "Driver", 0&, REG_SZ, _ 
     ByVal DriverPath, Len(DriverPath)) 
     lResult = RegSetValueEx(hKeyHandle, "LastUser", 0&, REG_SZ, _ 
     ByVal LastUser, Len(LastUser)) 
     lResult = RegSetValueEx(hKeyHandle, "Server", 0&, REG_SZ, _ 
     ByVal Server, Len(Server)) 
     
     'Close the new DSN key. 
     
     lResult = RegCloseKey(hKeyHandle) 
     
     'Open ODBC Data Sources key to list the new DSN in the ODBC Manager. 
     'Specify the new value. 
     'Close the key. 
     
     lResult = RegCreateKey(HKEY_LOCAL_MACHINE, _ 
     "SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources", hKeyHandle) 
     lResult = RegSetValueEx(hKeyHandle, DataSourceName, 0&, REG_SZ, _ 
     ByVal DriverName, Len(DriverName)) 
     lResult = RegCloseKey(hKeyHandle) 
     
     End Sub 
     
    3. Run the project and click on the Command1 command button. Then open up the ODBC Data Source Administrator from the Control Panel. Your new DSN will appear along with the other system DSNs that you have already created. 
<END>     
對(duì) 于 這 個(gè) 問(wèn) 題 , 我 有 一 個(gè) 想 法 可 以 給 你 看 看 。 
    可 以 使 用 文 件 DSN來(lái) 處 理 。 可 以 通 過(guò) ODBC來(lái) 建 立 一 個(gè) 文 件 DSN, 可 以 得 到 它 存 放 的 目 錄 及 文 件 格 式 。 以 后 就 可 以 在 程 序 代 碼 中 對(duì) 這 個(gè) 文 本 格 式 的 文 件 進(jìn) 行 操 作 了 。 
<END>

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久影视传媒| 色婷婷综合久久| 99在线精品一区二区三区| 色88888久久久久久影院野外| 99久久精品情趣| 欧美美女喷水视频| 国产人久久人人人人爽| 性欧美疯狂xxxxbbbb| 国产伦精品一区二区三区免费迷| 国产成人啪午夜精品网站男同| 91网页版在线| 日韩欧美色综合| 亚洲不卡av一区二区三区| 国产传媒日韩欧美成人| 欧美日韩一二区| 日韩毛片精品高清免费| 欧美国产一区二区| 三级久久三级久久| 中文字幕一区二区三| 激情丁香综合五月| 亚洲精品视频免费观看| 欧美一级日韩免费不卡| 成人午夜激情在线| 国产欧美精品区一区二区三区| 中文字幕亚洲一区二区va在线| 天堂av在线一区| 成人动漫一区二区在线| 精品国产污污免费网站入口 | 精品黑人一区二区三区久久 | 日韩一级大片在线观看| 一区二区三区在线观看视频| 麻豆精品新av中文字幕| 欧美三级韩国三级日本一级| 国产精品欧美极品| 中文字幕成人网| 91色乱码一区二区三区| 一个色在线综合| 久久婷婷国产综合精品青草| voyeur盗摄精品| 久热成人在线视频| 亚洲欧美偷拍卡通变态| 日韩一区二区三区高清免费看看| 国产主播一区二区| 日日摸夜夜添夜夜添国产精品| 欧美成人一区二区三区片免费| 高潮精品一区videoshd| 亚洲成人自拍偷拍| 自拍偷拍亚洲综合| 中文字幕欧美激情一区| 精品成人免费观看| 91精品国产91热久久久做人人| 成人在线视频一区| 国产中文字幕一区| 国产一区不卡在线| 99国产精品久久| 欧美精品1区2区3区| 成人黄色网址在线观看| 国产日韩精品一区| 91免费看`日韩一区二区| 91九色最新地址| 成人自拍视频在线观看| 亚洲午夜久久久久久久久电影网| 色94色欧美sute亚洲线路一久| 国产精一品亚洲二区在线视频| 性久久久久久久| 免费成人在线视频观看| 国产成人av一区| 欧美日韩成人综合| 国产精品美女一区二区| 亚洲成人一区在线| 福利一区福利二区| 欧美第一区第二区| 久久久精品免费观看| 色综合网站在线| 欧美色图12p| 成人午夜激情片| 懂色av中文一区二区三区| 性欧美大战久久久久久久久| 久久这里只有精品视频网| 色综合久久久久网| 婷婷综合另类小说色区| 亚洲成va人在线观看| 亚洲午夜精品一区二区三区他趣| 亚洲精品国产一区二区精华液 | 亚洲一区二区三区自拍| 精品免费国产一区二区三区四区| 91精品国产综合久久香蕉的特点| 91年精品国产| 国产最新精品精品你懂的| 亚洲va韩国va欧美va| 亚洲一区二区三区中文字幕| 亚洲黄色尤物视频| 91啪亚洲精品| 午夜国产精品一区| 国产精品私人自拍| 国产日韩精品一区二区三区 | 老司机精品视频一区二区三区| 91丨九色丨尤物| 亚洲欧美日韩中文播放 | 精品国产乱码久久久久久图片 | 青椒成人免费视频| 精品动漫一区二区三区在线观看| 亚洲成人精品一区二区| 成人深夜福利app| 久久久99精品免费观看| 日韩av网站免费在线| 欧美二区三区91| 天天色天天操综合| 欧美一级理论片| 男女性色大片免费观看一区二区 | 久久综合九色欧美综合狠狠| 日韩一区二区精品葵司在线| 91视频免费观看| 91丨九色丨黑人外教| 久久久99久久精品欧美| 亚洲视频 欧洲视频| 丰满白嫩尤物一区二区| 欧美经典一区二区| 99热在这里有精品免费| 一区二区三区在线观看网站| 欧美日韩视频第一区| 久久99国产精品麻豆| 国产日产欧美精品一区二区三区| 成人午夜免费av| 免费日韩伦理电影| 日韩毛片高清在线播放| 日韩一区二区三区视频在线观看| 国产成人三级在线观看| 亚洲一区二区黄色| 久久久久久久国产精品影院| 欧洲一区在线电影| 国产精品亚洲成人| 日本女优在线视频一区二区| 国产精品久久久久久久久久免费看| 欧美日韩久久不卡| 91日韩在线专区| 粉嫩13p一区二区三区| 麻豆视频观看网址久久| 亚洲欧美日韩国产综合在线 | 久久久亚洲高清| 国产另类ts人妖一区二区| 色婷婷久久久久swag精品| 国产喷白浆一区二区三区| 国产精品主播直播| 国产精品视频一二| 欧美zozo另类异族| 欧美日韩国产另类不卡| 色久综合一二码| 色婷婷激情一区二区三区| av不卡免费在线观看| 色欧美片视频在线观看在线视频| 日韩国产一二三区| 久久久久久久久久久久电影| 91麻豆福利精品推荐| 国产日韩在线不卡| 91成人网在线| 欧美日韩高清一区二区不卡| 99国产精品久久| 99精品久久99久久久久| 五月天久久比比资源色| 亚洲福利视频三区| 日韩电影免费在线看| 精品一区二区三区免费| 国产成人在线色| 色婷婷亚洲精品| 日韩一区二区影院| 亚洲国产精品t66y| 一区二区三区加勒比av| 日本女人一区二区三区| 福利电影一区二区| 欧美乱熟臀69xxxxxx| 国产午夜亚洲精品羞羞网站| 亚洲视频一区二区在线| 激情综合亚洲精品| 在线亚洲高清视频| 国产精品国产三级国产三级人妇 | 欧美精品vⅰdeose4hd| 国产女人水真多18毛片18精品视频| 亚洲大片一区二区三区| av在线一区二区三区| 久久午夜色播影院免费高清 | 93久久精品日日躁夜夜躁欧美| 制服丝袜中文字幕一区| 亚洲手机成人高清视频| 国产综合成人久久大片91| 欧美一级黄色录像| 美女视频一区二区| 精品国产一区久久| 精彩视频一区二区三区| 精品精品国产高清a毛片牛牛| 亚洲成人自拍网| 日韩午夜av电影| 激情欧美日韩一区二区| 国产午夜精品一区二区三区视频| 精品夜夜嗨av一区二区三区| 精品国产三级电影在线观看| 国内精品在线播放| 国产精品动漫网站| 69堂精品视频| 成人av网站免费观看|