db = "C:\Users\username\databases\employeeID.mdb"
TextExportFile = "C:\Users\username\databases\Exp.txt"
Set cn = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
cn.Open "Provider = Microsoft.Jet.OLEDB.4.0; " & "Data Source =" & db
strSQL = "SELECT IDNumber+','+Name FROM employeeID "
rs.Open strSQL, cn, 3, 3
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.CreateTextFile(TextExportFile, True)
a = rs.GetString
f.WriteLine a
f.Close
===
db = "C:\Users\amoore19\databases\employeeID.mdb"
Set cn = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
Set mstream = CreateObject("ADODB.Stream")
mstream.Type = 1 ''adTypeBinary
cn.Open "Provider = Microsoft.Jet.OLEDB.4.0; " & "Data Source =" & db
strSQL = "SELECT AimsIDNumber,photo FROM employeeID WHERE AimsIDNumber like 'A00%' and photo is not null"
rs.Open strSQL, cn
DO WHILE not rs.eof
mstream.Open
mstream.Write rs("photo")
mstream.SaveToFile "C:\images\all\" & rs("AimsIDNumber") & ".jpg", 2 ''adSaveCreateOveWrite
mstream.close
rs.movenext
Loop
===
db = "C:\Users\username\databases\employeeID.mdb"
TextExportFile = "C:\Users\username\databases\Exp.txt"
Set cn = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
Set mstream = CreateObject("ADODB.Stream")
mstream.Type = 1 'adTypeBinary
cn.Open "Provider = Microsoft.Jet.OLEDB.4.0; " & "Data Source =" & db
strSQL = "SELECT IDNumber,Name FROM employeeID "
rs.Open strSQL, cn
Do Until rs.EOF
mstream.Open
mstream.Write rs("Name")
mstream.SaveToFile rs("IDNumber"), 2 'adSaveCreateOveWrite
mstream.close
rs.MoveNext
Loop
'Set fs = CreateObject("Scripting.FileSystemObject")
'Set f = fs.CreateTextFile(TextExportFile, True)
'a = rs.GetString
'f.WriteLine a
'f.Close
'메모' 카테고리의 다른 글
ascii table...펌 (0) | 2016.07.07 |
---|---|
range.replace in vba...펌 (0) | 2016.07.07 |
BLOB data access and modify...펌 (0) | 2016.06.29 |
가벽 바닥고정은 양면테이프와 실리콘, 천정은 못이나 스크루로 고정...펌 (0) | 2016.06.29 |
absorbance, optical depth(density?)...펌 (0) | 2016.06.21 |