如何一次查询一个ACCESS数据库的所有表和字段?
展开全部
把表一个一个地打开,ctrl+f查吧。。。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Option Explicit
Private Sub addcmd_Click()
Dim songname As String
Dim songpath As String
Dim songtype As String
Dim ilist As Integer
Dim jlistmax As Integer
Dim i As Integer
Dim adocnn As ADODB.Connection
Dim adorst As ADODB.Recordset
Dim mdbpath As String
Dim cnnstr As String
Dim sqlstr As String
Set adocnn = New ADODB.Connection
Set adorst = New ADODB.Recordset
adorst.CursorLocation = adUseClient
mdbpath = App.Path & "\playlist.mdb"
cnnstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & mdbpath & ";Persist Security Info=False"
sqlstr = "Select * from playlist"
adocnn.Open cnnstr
adorst.Open sqlstr, adocnn, adOpenKeyset, adLockOptimistic
jlistmax = Filelist.ListCount - 1
If typecomb.Text = "*.mp3" Then
songtype = "MP3"
ElseIf typecomb.Text = "*.wma" Then
songtype = "WMA"
ElseIf typecomb.Text = "*.mdi" Then
songtype = "MDI"
Else: typecomb.Text = "*.wav"
songtype = "WAV"
End If
songpath = Dirlist.Path
For ilist = 0 To jlistmax
adorst.AddNew
songname = Filelist.List(ilist)
i = InStr(1, songname, ".")
songname = Left(songname, i - 1)
adorst.Fields("歌曲名") = songname
adorst.Fields("歌曲存储地址") = songpath
adorst.Fields("歌曲文件格式") = songtype
adorst.Update
Next ilist
adorst.Close
adocnn.Close
Text1.Text = ""
Call Form1.refreash_Click
End Sub
Private Sub cancelcmd_Click()
Unload Me
End Sub
Private Sub Dirlist_Change()
Filelist.Path = Dirlist.Path
End Sub
Private Sub Drivelist_Change()
Dirlist.Path = Drivelist.Drive
End Sub
Private Sub Filelist_Click()
Text1.Text = Filelist.filename
End Sub
Private Sub Form_Load()
Filelist.Pattern = "*.mp3"
typecomb.Text = "*.mp3"
typecomb.AddItem "*.mp3", 0
typecomb.AddItem "*.wma", 1
typecomb.AddItem "*.wav", 2
typecomb.AddItem "*.mdi", 3
End Sub
Private Sub typecomb_Click()
Filelist.Pattern = typecomb.Text
End Sub
Private Sub addcmd_Click()
Dim songname As String
Dim songpath As String
Dim songtype As String
Dim ilist As Integer
Dim jlistmax As Integer
Dim i As Integer
Dim adocnn As ADODB.Connection
Dim adorst As ADODB.Recordset
Dim mdbpath As String
Dim cnnstr As String
Dim sqlstr As String
Set adocnn = New ADODB.Connection
Set adorst = New ADODB.Recordset
adorst.CursorLocation = adUseClient
mdbpath = App.Path & "\playlist.mdb"
cnnstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & mdbpath & ";Persist Security Info=False"
sqlstr = "Select * from playlist"
adocnn.Open cnnstr
adorst.Open sqlstr, adocnn, adOpenKeyset, adLockOptimistic
jlistmax = Filelist.ListCount - 1
If typecomb.Text = "*.mp3" Then
songtype = "MP3"
ElseIf typecomb.Text = "*.wma" Then
songtype = "WMA"
ElseIf typecomb.Text = "*.mdi" Then
songtype = "MDI"
Else: typecomb.Text = "*.wav"
songtype = "WAV"
End If
songpath = Dirlist.Path
For ilist = 0 To jlistmax
adorst.AddNew
songname = Filelist.List(ilist)
i = InStr(1, songname, ".")
songname = Left(songname, i - 1)
adorst.Fields("歌曲名") = songname
adorst.Fields("歌曲存储地址") = songpath
adorst.Fields("歌曲文件格式") = songtype
adorst.Update
Next ilist
adorst.Close
adocnn.Close
Text1.Text = ""
Call Form1.refreash_Click
End Sub
Private Sub cancelcmd_Click()
Unload Me
End Sub
Private Sub Dirlist_Change()
Filelist.Path = Dirlist.Path
End Sub
Private Sub Drivelist_Change()
Dirlist.Path = Drivelist.Drive
End Sub
Private Sub Filelist_Click()
Text1.Text = Filelist.filename
End Sub
Private Sub Form_Load()
Filelist.Pattern = "*.mp3"
typecomb.Text = "*.mp3"
typecomb.AddItem "*.mp3", 0
typecomb.AddItem "*.wma", 1
typecomb.AddItem "*.wav", 2
typecomb.AddItem "*.mdi", 3
End Sub
Private Sub typecomb_Click()
Filelist.Pattern = typecomb.Text
End Sub
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询