Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

importovanje excel fajlova u access

[es] :: Access :: importovanje excel fajlova u access

[ Pregleda: 3822 | Odgovora: 2 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

MarkoA
Beograd

Član broj: 24600
Poruke: 80
*.sezampro.yu.



Profil

icon importovanje excel fajlova u access23.01.2005. u 18:53 - pre 234 meseci
Pozdrav. Treba da importujem excel fajlove, formatirane na odredjeni nacin, u jednu tabelu u Accessu. Da li imate neki predlog kako bi se to moglo automatski izvesti (ne preko import wizarda), s obzirom da ce biti potrebno unositi oko 100 fajlova dnevno...
 
Odgovor na temu

Simke
Marko Simic
Sandfield Associates (Solution
Developer)
Novi Zeland

Član broj: 1158
Poruke: 751
*.bitstream.orcon.net.nz.

ICQ: 71578686
Sajt: www.sandfield.co.nz


Profil

icon Re: importovanje excel fajlova u access24.01.2005. u 08:52 - pre 234 meseci
Pogledaj DoCmd.TransferSpreadsheet
All beer is good. Some beer is better.
 
Odgovor na temu

MarkoA
Beograd

Član broj: 24600
Poruke: 80
*.sezampro.yu.



Profil

icon Re: importovanje excel fajlova u access24.01.2005. u 14:04 - pre 234 meseci
Mislio sam na ovo:

Code:

 Private Sub cmdImportFiles_Click()
' Convert the Excel files to a text file so that they can then be imported
Dim intFileCount As Integer

On Error GoTo ErrorHere

With Application.FileSearch
.NewSearch
.LookIn = "Folder of Excel files path name" ' You could use the FileDialog object to let the user select the folder with the Excel spreadsheets in them orjust hard code it.
.SearchSubFolders = False ' set to true if you want subfolders to be searched
.FileName = "*.xls"
.FileType = msoFileTypeExcelWorkbooks
If .Execute Then
For intFileCount = 1 To .FoundFiles.COUNT
' You might need to change some of these options depending on your version of Excel, range names, field names etc
DoCmd.TransferSpreadsheet transferType:=acImport, SpreadsheetType:=acSpreadsheetTypeExcel9, TableName:="MyTable", FileName:=.FoundFiles(intFileCount), HasFieldNames:=True
Next intFileCount
Else
MsgBox "No Excel files were found", vbInformation, "No Excel Files Found"
GoTo ExitHere
End If
End With
ExitHere:
Exit Sub
ErrorHere:
MsgBox "Error In: Form '" & Me.Name & "'" & vbCrLf _
& "Procedure: cmdImportFiles_Click" & _
vbCrLf & "Error Code: " & Err.Number & _
vbCrLf & "Error: " & Err.Description, vbExclamation, "Error Alert"
Resume ExitHere
End Sub
 
Odgovor na temu

[es] :: Access :: importovanje excel fajlova u access

[ Pregleda: 3822 | Odgovora: 2 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.