Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Access Import Wizard && VB 6


Hello!

I am currently migrating an application from Access 2000 to VB 6. All was going fine till I came to the following line which appears to be unique to Access.

DoCmd.RunCommand acCmdImport

This Access import wizard is critical to my application due to its flexability and GUI. Is there a way to code this Access command (or equivlant wizard) into Visual Basic 6? Thanks!




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
What Is The Table-like Control In Excel Or Access Import Wizard
Dear friends,

I wish to build an "import wizard" in my application and it's function is very much like the Text Import wizard in Excel or Access.

Have u ever try importing a text file into them, it can parse the delimited text file and split the data item into columns and show in a table-like control which has grey color field names on top and row number on left and cell borders.

Do you know what this control is? Do you have any suggestion on the common way to build import wizard?

Thanks

Text Import Wizard
I’m getting files generated by a DOS program (that doesn’t have the option of exporting files to .txt or .xls
The files have no extension. File type = File
I have to open excel and use the Text Import Wizard

Every time I need to select the import settings, like delimited type etc.

Is there a way to have the setting saved and just import it?

Thank you

Text Import Wizard?
Could someone help me how to call Access text import wizard from VB or Excel text import wizard?

Dts Import Wizard Of Sql In Vbcode
hi to all.
this is my first time to do this code, so if anyone have an idea
regarding my problem then i will be grateful..

i need to import a text file to a sql database. of course, it can be done
easily using the dts wizard of sql. My problem is , i don't know how
to "call" the dts in vb.

does anyone have an idea?

thanks in advance.

anna

Import Export Wizard
I am using VB6.0 with SQL8.0. I am using DTS Import Export Wizard to transfer data from one ODBC to other. I always get data for pervious day , i have saved my dts package and want to run everyday around certain time.My question is how do u handle my query to get data from previous days.

Thanks for any help

Excel Text Import Wizard
I was wondering if anyone knows if there is a way to control the text import wizard in excel. The wizard opens when you try to open a file that is not in excel format. I want to be able to open the wizard at the least and hopefully be able to control it. Thanks in advance for your help.

Creating An Import Wizard For .txt File
Hi all

I've tried the Database Forum with no success (0 replies)

I'm wondering if on the off chance there is a way of grabbing the Access Import wizard and use inside VB? or a similar procedure?

I'm using an Access database, ADO, VB 6.0 SP3 and an MSFlexgrid. I would like to import a user selected ascii text file, allowing the user to select certain rows/cols/headers etc... so I can then re-arrange into the right format for my app (a basic cashflow). The info from the text file, would be exported out of the users existing app into my own.

Any ideas, or is it better to just create my own?

Thanks in advance...

Call The Import Wizard Screen
Hi, i am trying to create a form in MS Access that's user friendly. It should allow the user to import text files basically what is done when you click on "Get External Data" -> Import. I want to call the Import Wizard Screen when a user clicks on a button.

Is it possible? If so, then how can i do it?

Text File Import Wizard
Hi Everyone...

Has anybody maybe created (or know of a decent 3rd party ocx/dll) a Text
File Import Wizard SIMILAR to MSExel's or Access' File Import Wizards OR is
it possible to use the existing MS wizards in some way from a VB app ??

Any help would be greatly appreciated !!

Ockert

Code Similar To EXCEL Text Import Wizard
Hello all,

in my application i need to import a text file, which does not have delimiters.
i need to split the text into columns, (UI similar to Excel text import wizard).

Thanks for any help in advance

Making Excel Text Import Wizard Look-alike
Hi,

I`m writing a wizard that very much resembles the Excel Text Import
Wizard. So far so good but I have been unable to find a control to
reproduce the step where the user picks the boundries of a fixed width
text file. The file will be displayed in a fixed-width font, the user
can insert a dividing line by clicking, remove by double clicking and
move by dragging. The lines must move as a file with wide lines is
scrolled. I must be able to read the position of the lines in relation
to the number of characters along a line.

Any idea, please...

Ed.

Vb Code Similar To Excel Text Import Wizard
Hello all,

I need to split a fixed format string into columns. (UI similar to excel text import wizard) where a user can drag a line to fix the boundaries).

Thanks for any help in advance

Using Outlook Import/Export Wizard Functionality Through Macros
Hello,

I have been spending quite a lot of time recently trying to access the functionality provided by the Import/Export Wizard in Outlook to export the contents of a mail folder to a .pst file.

I have tried to find a way to do this through the Outlook Object Model, but there doesn't seem to be any methods on the MAPIFolder object that do what I want.

I have also tried to do it using SendKeys, but for some reason I can't send a {ENTER} key to the second page of the wizard to move to the next page.

If anyone can help me with this, I would be very grateful, as I've spent quite a while on it, and have run out of ideas.

Thanks,

Muhmud.

Please Help About "Text Import Wizard"
I am developing an application that importing a text file into Access database. Well, the problem is that there is no fixed format for the text file: it could be comma delimiter, tab delimiter, or fixed columns. I finished writing the codes for using any characters as the delimiter but for the fixed columns type, I still figure a way to use the "Text Import Wizard" from Access or Excel to do this task. Can some one give some hints about this or is it possible to do?

Thanks in advance.

Import E-Mails From Outlook To Access, And Read Them From Access?
How do I import E-Mails from specified folder in Outlook to Access. I want to read the imported mails from Access also?
How do I do that?

Import E-Mails From Outlook To Access, And Read Them From Access?
How do I import E-Mails from specified folder in Outlook to Access. I want to read the imported mails from Access also?
How do I do that?

How To Import Access 5 To 6 Access Tables Into Vb Using Vb Code.......
help me in accessing MS access tables by vb ....let me kno the steps in detail ........ I ve around 5 to 6 tables created in access and using vb 6.0 as front end now i need to access these tables and display it once the user strikes the command button so please let me know how to do it with code .



Thanks in advance...

Import To Access
I need to import an Excel spreadsheet into an Access table through Visual Basic 6. Is this possible and, if so, how? I read somewhere about a TransferSpreadsheet method, but I'm not sure how to use it and what references must be included to enable it. Can someone please help? Thanks.

m.

Import To Access
Hi

Using VB, have written code to go line by line in an excel file and save the data in access but is very slow.

Can i use the transferspreadsheet command from VB to import save all the data from an excel file to an access DB (created earlier in the program). if so, how?

Thanks

Import From Access
I'm trying to import information from a table in an access database and only receiving garbage. I'm using the standard, open "database" for import as #1 statement and receive 3 fields containing, 0,0, with the 3rd field containing strange character combinations. What am I missing?

Import SQL Into Access
Is it possible to pass a SQL statement from VB into Access where it can then be saved as a view. I have a SQL builder that needs save, delete, and edit properties. Am I better off saving the statements in text files or is there a way to import queries through vb?

Import A CSV Into Access From VB6
Hi,

Here is the scenario, I'm writing an application in VB that pulls data either out of an Access or SQL db, run's it through some software to varify the addresses and then reimports it and does some resulting.

The problem is i can't find a way i'm happy with for getting the data back into Access, with SQL its not a problem i just use a DTS with some global variables.

The only way i can see to do it is to open both the text file and the Access db, and loop through the text file adding in records to the Access table, which is very slow.

The only other possible way i can think to do it is to use a SQL dts with a text file source and an Access Detination, but i'm not keen on that either, bit round the house's + the users may not have access to a sql server.

Anyone got a better way to do it?

Thanks
Bob.

Access 2k Import
Hey y'all,

I have just written a new import routine which uses the following line:


Code:
DoCmd.TransferText acImportDelim, "MPEImport", "HOLDING_DATA_MPE", strMPEInputFolderPath & "" & strNewInputFileName


The import spec MPEImport has the same fields as the table HOLDING_DATA_MPE bar 1 (which is used for date formatting).

I have tried to manually import to check that the output file to be imported (strNewInputFileName) contains the correct fields in the correct order. The fields are all in the correct places but I get an error telling me that the file may not exist (altho it definatly does coz I had to find the file in an FSO to import it and I could see the field values in the wizard).

Deciding that this could be a bug with the manual import, I proceeded to test the code import. I get no error but some of the fields are missing so the remaining fields have all been pushed over to the left.

Does anyone know what could be wrong here?

The file needs to be changed to txt format (from a .bill extension) , which is done in code but can be done manually if you want to try a manual import. It can be read in notepad.

I have attached the .bill file (also sheet1 on .xls), the import spec MPEImport (Sheet2 on .xls) and the resulting HOLDING_DATA_MPE table content (sheet3 on .xls)

Access Wizard
I want to create form creation wizard in VB

Something Like Access Form builder Wizard.

How can i create a component eg text box and save it

I can load it at run time but it will not be saved permanentaly

what to do ?

Import / Query In Access Via VB
Hiho,

i have the following problem which includes these three componets:

- vb application
- datafile (*.txt)
- access database

now i want a command button in VB, which when it gets clicked imports the *.txt in the access database an runs a view queries.

How can this be realisied, can anybody give me some suggestions or a vb code example?

thx & c ya

Salva

Import Excel Into Access.
I know there are a number of examples of this already but I can't seem to get them working. This is my code and I get an error (80004005) 'The database has been placed in a state by user...'

I assume I can't run this code from the mdb I am trying to import into. What I want to do is have a button on a form that will load an excel file to a table. So - from excel to an open access db. Does anyone have time to look at this?


Code:
Private Sub cmd_importExcel2_Click()
Dim Cn As ADODB.Connection

Set Cn = New ADODB.Connection

'lets connect to the workbook first, I tested this, it works for me
Cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:New ProjectsImpact Tool est.xls;Extended Properties=Excel 8.0;" _
& "Persist Security Info=False"

<b>'Here is the problem - can I just point to the current open db?</b>
' Append data from Sheet1 of workbook to Table1 of mydb.mdb:
Cn.Execute "INSERT INTO [Table1] IN 'D:New ProjectsImpact Tool est.mdb' SELECT * FROM [Sheet1$]"

'Cn.Close
Set Cn = Nothing
End Sub

After this - does anyone know of good links that show how to read through a record set? What I would like to do is load the excel file as a RS before I insert it - and then check the first two fields to see is they are valid (if the city is in the right province etc.)?

Excel Import To Access
I'm running this code in a window script. (extention .vbs)

set oAcc = CreateObject("Access.Application")
oAcc.Visible = True
oAcc.OpenCurrentDatabase "C:Shipping DatabaseShippingDatabase.mdb"
oAcc.DoCMD.TransferSpreadsheet 0,8,"Freight Tracking Database","C:InetpubwwwrootCopy of SHIPPING.xls",0
oAcc.UserControl = True

I need something a little more complicated. My Field Names are not the same between Excel and Access so the TransferSpreadsheet doesn't work. I would like to run an SQL INSERT Statement to transfer everything over and then I can use aliases and other fun things. I know another way to do this in asp but you have to have a named range which isn't possible in my situation. I'm not sure where to go from here. I don't have visual studio so everything I do needs to be done from windows scripting host or asp.

Basically:
Is there anyway to execute a SQL statement in the code above that will affect the whole spreadsheet without needing a named range?

Import From Word To Access
Is it possible to import data from a table in a word document into an access table?

The table in Word is a standard table and the first cell contains a bookmark.

Any suggestions?

tnx

Access Import From Excel Help
Hello all,

Oh, here's the deal I have information in Microsoft Excel, which I need to process and append to the access database.

So I first import the data from excel to access on a temporary table using:

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "tblTemp", strRet, False, "Sheet1!A2:N65536"

Having done that now i need to cycle through each record in the temporary table and send it into the production database with those who satisfy my SQL statement ...

I need all this to be done programmatically... HELP

Import OLE Object Into Access Via VB
Hello All, I creted some code that automatically exports a single message from Outlook. However, problem occurs when I want to import that message into an Access 2002 database. Does anyone know how to import an OLE into an Access database via VB?

I have a table called tblTemp with two fields; PurchaseID (auto number) & ApprovalDocument (ole object).

Thanks for the help.

Import A Form From Access To VB6
In an effort to port over an older MS Access project to Visual Basic, I am wondering if it's possible to import the forms. I can pull the code over easy enough, but I can't find a way to get the actual form. Is this even possible?

Need Help With Access VBA And Text Import
Thanks!

I have been moderately successful after scouring the web for suggestions. I am now having problems importing the text from a file into an array. Maybe an array is not the best solution. Aay ideas would be greatly appreciated.

Here is a sample of the text file: I want to be able to read in each line into a a field in the database. Each trip between the *========= lines varies in number of lines.

Thanks again,

Jim

*===================================================================== ========*
J2291 Check-In 15:35 Check-out 16:10 MAY2005 5-Day
Flt Dep Local Arr Local Turn Rest Block Duty +---------------------+
91 JFK 16:35 OAK 19:45 *10:35 06:10 07:25 |S M T W T F S |
Airport Courtyard (510-568-7600) |=====================|
474 OAK 07:20 BOS 16:00 *13:30 05:40 06:40 |-- -- -- -- -- -- -- |
HOLIDAY INN (617-569-5250) |-- -- -- -- -- -- -- |
481 BOS 06:30 LGB 09:45 *23:25 06:15 07:15 |15 -- -- -- -- -- -- |
Marriot Airport Long Beach (562-425-5210) |-- -- -- -- -- -- -- |
307 LGB 10:10 IAD 18:05 *13:10 04:55 05:55 |-- -- -- |
Holiday Inn Select (703-815-6060) +---------------------+
301 IAD 08:15 FLL 10:45 02:25*
40 FLL 13:10 JFK 15:55 05:15 08:40

Credit 28:15 TAFB 96:35
*===================================================================== ========*
J2292 Check-In 17:15 Check-out 09:10 MAY2005 5-Day
Flt Dep Local Arr Local Turn Rest Block Duty +---------------------+
107 JFK 18:15 OAK 21:40 *11:25 06:25 07:40 |S M T W T F S |
Airport Courtyard (510-568-7600) |=====================|
472 OAK 10:05 BOS 18:45 *11:45 05:40 06:40 |-- -- -- -- -- -- -- |
HOLIDAY INN (617-569-5250) |-- -- -- -- -- -- 14 |
441 BOS 07:30 TPA 10:45 00:50 |-- -- -- -- -- -- -- |
444 TPA 11:35 BOS 14:30 *22:40 06:10 08:00 |-- -- -- -- -- -- -- |
Omni Parker House (617-227-8600) |-- -- -- |
435 BOS 14:10 MCO 17:10 *12:20 03:00 04:00 +---------------------+
Country Inn & Suites (407-856-8896)
52 MCO 06:30 JFK 08:55 02:25 03:25

Credit 23:40 TAFB 87:55

Automated Import (ACCESS)
Hello all,

Here's another conundrum for you guys. I'm trying to create a facility whereby the user would be able to choose various types of files to import (Excel, Text etc...) and their location and import them into a designated table (created on the fly, but that's not important right now)

My problem is that the format of the files are different every time (coming from different clients), so i don't know how i could duplicate the wizard that analyses the data and puts it in the right fields i.e. delimited or fixed width option, seperated by comma and so on...

Now, Excel is easy (as long as the input table has F1,F2...Fn as field names), but how do i do the same with a TXT file, especially when it comes to Fixed Width and a DOS method of string saving (try any export from access to see that).

Any help here would be hot.

Thanks,

Dor

p.s. I supply the code i tried with readline, putting it into an array for analysis, but that's where i come stumped.


Code:

'Connect to external database and delete the array table so it can be recreated
Set dbClientDB = OpenDatabase(strDBPath, True, False)
For Each tblArrayTable In dbClientDB.TableDefs
If tblArrayTable.Name = "tblArrayTable" Then
dbClientDB.TableDefs.Delete tblArrayTable.Name
dbClientDB.TableDefs.Refresh
Exit For
End If
Next tblArrayTable
'Create the array table with 250 fields for examination by the user
Set tblArrayTable = dbClientDB.CreateTableDef("tblArrayTable")
For lngCounter = 1 To 250
Set fld = tblArrayTable.CreateField("F" & lngCounter, dbText, 250)
tblArrayTable.Fields.Append fld
Next lngCounter
dbClientDB.TableDefs.Append tblArrayTable

'Delete the link to the array table if exists in the database and relink it (works on whether it existed b4 or requires it anew)
For Each tblArrayTable In CurrentDb.TableDefs
If tblArrayTable.Name = "tblArrayTable" Then
DoCmd.DeleteObject acTable, tblArrayTable.Name
CurrentDb.TableDefs.Refresh
Exit For
End If
Next tblArrayTable
DoCmd.TransferDatabase acLink, "Microsoft Access", strDBPath, acTable, "tblArrayTable", "tblArrayTable"

'Determine client file format and import 10 lines from the file to put into the array table for examination by user
Select Case fraFileType
Case 1 'Text
Set varScriptingAgent = CreateObject("Scripting.FileSystemObject")
Set varImportTextFile = varScriptingAgent.OpenTextFile(fldImportFileLocation, 1)
For lngCounter = 1 To 10
If varImportTextFile.AtEndOfStream Then Exit For
strImportLineArray(lngCounter) = varImportTextFile.readline
Next lngCounter

'This is where i come undone. How can I analyse the data in the array to determine what to put in which field???

Case 2 'Excel

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "tblArrayTable", fldImportFileLocation, False
'Various code to change the field names as requested if first line contains field names

End Select

Import A Access Report Into VB
Is it possible to Import a Report Inside a Access Database into Vb?

Import Text To ACCESS
Hi everyone..
I am actually doing the program in ACCESS using DoCmd. Transfertext. I set up the specification file, and manually it works and import the file on the table. But to automate it.. I have something like..
Dim strFile As String
Dim myPath As String

MsgBox CurDir
myPath = CurDir
strFile = myPath & "sr14"
strFile = "" & strFile & ""
DoCmd.TransferText acImportFixed, "sr14-import", "SR0014short", strFile
MsgBox "SRR014 raw data upload was successfull", vbOKOnly

Now the problem is I get a runtime error:Runtime error"3051" MsJet database engine canot open the file "sr14.txt"
It is already open exclusively by another user, or you need permission to view its data..

I don't understand, the file is not at all open, and also the file cannot be opened by another user because I am the only user of my network drive. I also am the only one who have access to it, so I don't need permission to view its data. Please suggest any thing that I missed on my codes.

Thanks.

Import CSV File Into Access DB
I've searched the forum for an easy to follow example that works on this topic but couldn't find one so hense my question.

I want to be to import a CSV file into an existing table within my access database. The CSV file has 3 columns which are Date, Amount and Description.

This code finds the file, opens it and then reads the contents. What I need help with is how to use this code to import into an existing access database. Any help would be appreciated.

Code:
Private Sub Import_Click()
Dim arrData() As String
Dim s As String
Dim i As Integer

Open "C:Card.csv" For Input As #1
Do While Not EOF(1)
Line Input #1, s
arrData = Split(s, ",")

For i = 0 To UBound(arrData)

Debug.Print arrData(i)

Next i

Loop
Close #1

End Sub

Import Access Form
I have a form that I made in Access 2000, I was wondering if it is possible to open/import that to a VB program.

Basically, I wrote up a program just for that database, but to enter data you still have to open up Access, and go to the form to enter data. It would be a lot more user friendly (and I would also be happy to learn this) to just have the form open up in the program.

Now, perhaps if I can't do that I could recreate the form (just some text-boxes, and combo-boxes), have the user enter the data and use SQL to update the original access form. However, it would be so much easier to just import it somehow.

If anyone has any ideas or thoughts, I would appreciate it.

Thanks~

Import XML Into Access 2000
I have searched many internet forums searching for an answer to this question: How can I import XML into Access 2000? OR how can I get XML into Access 2000 via VBA?

Import Txt File To Access
I have several txt files all with different fieldnames. Currently the database imports them into a table using transfer text. I need all the fields to be text but things like postcodes are going is as numeric fields. I am aware of the schema.ini files but cant see how I can get it to use the fieldnames from the file (because they always change) but set all fields to text. Is there any way other than programming??

I was thinking maybe read txt file to get the fieldnames and create table 1st
then I can set all fields format to txt
then import file

thought there may be a better/quicker way I am not aware of

Import From Excel To Access
Is there an easy way to do this? I need to copy the entire Sheet 1 (with the except of row one [headers]) to the end of a current table. Any ideas on how I can do this?

Thanks!

***EDIT***
Let me clarify here... I know about both ADO and TransferSpreadsheet (and Text), but I think ADO is going to be the easiest to do. I'm just not sure how I'm to select everything from A:1 to the end of Sheet 1 (thru the range) using and ADO commands.

Access Database Import
I am trying to import a text delimited file into a Access database. I can do this manually without any errors, but when I do it through the VB code using the input statement and adding records to the database, I get an error when...

Some of the fields I am importing have double quotes in the line ("). The VB code is treating them as a field separator while the Access import function does not.

Is there a way to cause the Access import function to start from within VB, or is there a way to get around the double quote problem?

Any help would be appreciated.

Import Access Form To VB App?
I've heard that it may be possible to import a form from an Access MDB file into a VB app.

Anyone else heard of this?

A quick search looks like there may be 3rd-party tools for this, but, three's a crowd.

Import From Access To Excel?
I Import from Access to Excel, but I have a problem when it is many rows to import to excel.
Somtimes it's over 65 000 rows I import to excel, and there is where the problem is. Excel only handle 65 000 rows per workcheet and I want the code automaticly create a new workcheet in excel after 65 000 rows. How do I do that?

Access Import Oddity? Chr(26)
anyone know what a chr$(26) is?

it appears as a box (like Cr or Lf) but its a 26
it causes access to think its at the end of the file even though its not

any help would be appreaciated.

Thanks
Static

Import Access Database
silly question, i know, but theres no easy way to import an access 2000 database, reports and quiries into vb is there?

cheers

Import Into An Access Database
Does anyone know the code to import a comma delimited text file into a new access table without creating the table first then looping through the text file to populate the table? Kind of like coding the import wizard?

Thanks,
Merlin

How To Import A Report From Access To A VB App?
Once upon a time someone in my company made a report in Access to make labels with the client's name, address, city and zip (each is a field in a "Clients" table).

Now I'm making a VB app and those labels are to be included in the app, so each label can be printed and glued to an envelope (just for you guys to understand what it is for).

In my app I have a form where the user selects wich Clients he wants to mail to, and therefore:
1- I have to tell to the report wich clients' name, address etc. will be in the report (report-alike "sheet")
2- Tell it to Print (since I have to create a Print button, but never coded anything related to a printer)
3- Put a "Mr." or "Mrs." in the line above the name line (yes, I have a gender field in the same table)

Can someone help me, especially in point 1 and 2?

Import This With Access Instead Of Excel?
Can anyone help me to change this code to import via Access instead of Excel.
I import a table with including fields from another system (SAP) to excel. Now I wanna do this in Access.

The tablename in Access is Test1.
In this exemple, excel import to a Worksheet.

Here is the code:

VB Code:
Function Excel_Import() Dim iRow, iColumn, iStart, iStartRow As IntegerDim SEL_TAB, NAMETAB, TABENTRY, ROW As Object iStartRow = 1 iColumn = 1 For iRow = iStartRow  To TABENTRY.RowCount    For iColumn = 1 To NAMETAB.RowCount        iStart = NAMETAB(iColumn, "OFFSET") + 1'       If this is the last column, calculate the length differently than the other columns        If iColumn = NAMETAB.RowCount Then            iLength = Len(TABENTRY(iRow, "ENTRY")) - iStart        Else            iLength = NAMETAB(iColumn + 1, "OFFSET") - NAMETAB(iColumn, "OFFSET")        End If'       If the fields at the end of the record are blank, then explicitly set the value        If iStart > Len(TABENTRY(iRow, "ENTRY")) Then            Cells(iRow, iColumn) = Null        Else            Cells(iRow, iColumn) = Mid(TABENTRY(iRow, "ENTRY"), iStart, iLength)        End If    NextNext  End Function

Import From Excel To Access...how?
I want to import a worksheet in an excelfile into a new table in access. The tablename should have the same name as the worksheet. The fieldnames in access should be the same as the fieldname in excel. How do I do that?

Copyright © 2005-08 www.BigResource.com, All rights reserved