在 Visual Basic 中使用導入 API會發現很難找到正確的 dll
回答是肯定的
有兩種方法可以完成這項工作
的調用序列從 VB 調用它
Type SQLCA_STRUCT
sqlcaid As String *
sqlcabc As Long
sqlcode As Long
sqlerrml As Integer
sqlerrmc As String *
sqlerrp As String *
sqlerrd(
) As Long sqlwarn As String *
sqlstate As String *
End Type
Public Declare Function sqlepstart Lib "db
app" Alias "sqlepstart_api" (ByVal junk&#
; ByRef sqlca As SQLCA_STRUCT) As Integer
DB
_start = sqlepstart( sqlca) Start DB call
另一種方法就是生成一個文件
fileno = FreeFile
Open db
file For Output As #fileno sqlstmt = "" + _
"db
start;" + vbNewLine + _ "quit;"
Print #fileno
sqlstmt Write commands to a file Close #fileno
Close it and execute the command db
cmd = "db cmd /i /c db tvf " + db file Generate the command progID = Shell(db
cmd vbMinimizedNoFocus) Shell out to run it
最後
From:http://tw.wingwit.com/Article/program/net/201311/11600.html