borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (excel to sql server)Next Topic (need help in data display) New Topic New Poll Post Reply
AndreaVB Forum : Database : excel,foxprow to access
Poster Message
rdimky
Level: Protégé

Registered: 23-12-2004
Posts: 5

icon excel,foxprow to access

hello
my name is raju and i have to build the project my college term work in vb as frontend
in which i have to convert the database which is in excel and
foxprow(.dbf) into access (or any, which ever easier)
i have got the project for any to any database conversion from
this site but it is not converting my excel to access.
i have also have to take reports from combined resultant
database
i think some one can help i will be very pleasure to get
any thing from urs regards
thank u   

22-01-2005 at 07:31 PM
View Profile Send Email to User Show All Posts | Quote Reply
GeoffS
Level: VB Lord


Registered: 29-09-2004
Posts: 536
icon Re: excel,foxprow to access

Hi rdimky,
Take a look at this MS Knowledgebase Article on how to make an Access DB from Excel. It may be what you need.
http://support.microsoft.com/default.aspx?scid=kb;en-us;151566


____________________________
multi-tasking - the ability to hang more than one app. at the same time.

02-02-2005 at 10:50 AM
View Profile Send Email to User Show All Posts | Quote Reply
GeoffS
Level: VB Lord


Registered: 29-09-2004
Posts: 536
icon Re: excel,foxprow to access

Hi rdimky,

Your PM said

quote:

i have completed the first part of my project by combining two codes for converting excel and foxpro to access any how, but now the resulting ms access database contains two tables .I need to join these two table and need only one table so that i can use select queries for searching and updating that ONE table.I WANT ONLY ONE RESULTANT TABLE WHICH MUST BE UPDATABLE .if it is done than my project is done



Without knowing whats in your tables it is a bit difficult to say. Have you got two tables that are the same, but the  information in them is different 'cos you imported from two different places? If that is the case then you run an Append Query in Access to move the data from one table into another, thereby ending up with just one table. However, if the fields in the two tables do not match then you could create a brand new table for the final result, then run two Append Queries, one for each of your existing tables, mapping the fields from each table to the relevant field in your new table. After both have been run then you will have all the data in one table. This may sound complicated but the Query Designer in Access makes it quite easy.
Hope that helps.



P.S. The good thing about Forums like this is that everyone gets to read all the posts - and thereby all visitors can benefit. If we keep the problems private in a message like this then nobody else can benefit, so I have copied this onto your original posting so that all can see. Of course, if you feel that a particular Forum member is likely to be able to help you then there is no reason why a private message should not be sent asking if they can look at a specific post.
Geoff


____________________________
multi-tasking - the ability to hang more than one app. at the same time.
17-02-2005 at 03:49 PM
View Profile Send Email to User Show All Posts | Quote Reply
rdimky
Level: Protégé

Registered: 23-12-2004
Posts: 5
icon Re: excel,foxprow to access

thank u Geoff,

i actually was not  knowing  how to again ask the question that's why i have pm to u  .i will try the query designer of access mean while i liked to know whether two tables can be joined into resultant table , if two tables  contain similar named fields
i like to know the SQL query prefferably


thanks u again for urs generosity

17-02-2005 at 05:53 PM
View Profile Send Email to User Show All Posts | Quote Reply
GeoffS
Level: VB Lord


Registered: 29-09-2004
Posts: 536
icon Re: excel,foxprow to access

Hi rdimky,
You actually need 2 SQL statements to achieve this in Access, so the only way you can do that is to put a bit of code into a VBA Code module. Maybe a simple Form with a button on it, then you could use the Button_Click Event to run the code.
The code would first create a new Table from one of the existing tables, and insert all the data, the second SQL statement would then append into the new table all the data from the second table. If your first table contains an Autonumber Identity field then the new table will also get an Autonumber Identity field by inserting that field into the new table when it is created. Then when you append from the second table just leave that field out and the new records will get their own ID created for them.
Modify the following SQL Statements with your table and field names, then put it into your Form code module in the Button_Click Event, click and away you go!

Dim strSQL As String

strSQL = "SELECT Table1.Name_ID, Table1.FirstName, Table1.SecondName, Table1.Address_Street, Table1.Address_Town, Table1.Address_Code INTO Table3 FROM Table1"
DoCmd.RunSQL strSQL

strSQL = "INSERT INTO Table3 ( FirstName, SecondName, Address_Street, Address_Town, Address_Code ) " _
& "SELECT Table2.FirstName, Table2.SecondName, Table2.Address_Street, Table2.Address_Town, Address_Code FROM Table2"
DoCmd.RunSQL strSQL



____________________________
multi-tasking - the ability to hang more than one app. at the same time.

18-02-2005 at 12:12 PM
View Profile Send Email to User Show All Posts | Quote Reply
rdimky
Level: Protégé

Registered: 23-12-2004
Posts: 5
icon Re: excel,foxprow to access

hello geoff

thank to u for repling to my post every time
i am really very thankful to u for doing that needful help to me

this time i am in new trouble the following is the code in
ADOX which i have never used anywhere which unfortunately
comes in my downloaded code for converting dbase to access
can u please convert it into their equivalent ADODB code here
are some of these statements i can understood the difference
in adox and adodb
THESE ARE THE LINES IN ADOX THAT I WANT TO TRANSFER THEM TO ADODB


Dim catText As ADOX.Catalog
Dim tblText As ADOX.Table
Set catText = New ADOX.Catalog
catText.Create "Provider=Microsoft.Jet.OLEDB.4.0;" & _
                  "Data Source=" & strMdbFileName
                  
    Set catText = Nothing
----------------------------------------------------------------
Set tblText = New ADOX.Table

catText.ActiveConnection = strCon

With tblText
    Set .ParentCatalog = catText
    .Name = strLinkName
    .Properties("Jet OLEDB:Create Link") = True
    .Properties("Jet OLEDB:Cache Link Name/Password") = False
    .Properties("Jet OLEDB:Exclusive Link") = False
    .Properties("Jet OLEDB:Table Hidden In Access") = False
    
    .Properties("Jet OLEDB:Link Provider String") = GetDatabaseType(intSourceDatabaseType)
    .Properties("Jet OLEDB:Link Datasource") = strLinkedDatabaseName
    .Properties("Jet OLEDB:Remote Table Name") = strTableName
    catText.Tables.Append tblText
End With
RemoveLink = True
Set catText = Nothing
Set tblText = Nothing

-------------------------------------------------

For Each tblText In catText.Tables
    If tblText.Type = "LINK" Then
        catText.Tables.Delete tblText.Name
    End If
Next


if u want i can send  my module in which adox is used if in case u cant understand any think from the above code

thanks in advance

23-02-2005 at 07:40 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Database : excel,foxprow to access
Previous Topic (excel to sql server)Next Topic (need help in data display) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder