prjDAOTest.vbp
Type=Exe
Reference=*/G{00020430-0000-0000-C000-000000000046}#2.0#0#C:/WINDOWS/system32/stdole2.tlb#OLE Automation
Reference=*/G{00025E01-0000-0000-C000-000000000046}#4.0#0#C:/Program Files/Common Files/Microsoft Shared/DAO/DAO350.DLL#Microsoft DAO 3.51 Object Library
Form=frmMain.frm
IconForm="frmMain"
Startup="frmMain"
Command32=""
Name="prjDAOTest"
HelpContextID="0"
CompatibleMode="0"
MajorVer=1
MinorVer=0
RevisionVer=0
AutoIncrementVer=0
ServerSupportFiles=0
VersionCompanyName="www.UnionWare.com.cn"
CompilationType=0
OptimizationType=0
FavorPentiumPro(tm)=0
CodeViewDebugInfo=0
NoAliasing=0
BoundsCheck=0
OverflowCheck=0
FlPointCheck=0
FDIVCheck=0
UnroundedFP=0
StartMode=0
Unattended=0
Retained=0
ThreadPerObject=0
MaxNumberOfThreads=1
[MS Transaction Server]
AutoRefresh=1
frmMain.frm
VERSION 5.00
Begin VB.Form frmMain
Caption = "Form1"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Form_Load()
Dim db As DAO.Database
Dim strSql As String
Set db = DBEngine.OpenDatabase("c:/JackieJi.xls", False, False, "Excel 8.0;")
If db Is Nothing Then
MsgBox "失败"
Else
MsgBox "成功"
End If
'
' strSql = "select 'aaa' as aaa,'bbb' as bbb into JackieJi"
'
' db.Execute strSql
db.Close
Set db = Nothing
End Sub