473,800 Members | 2,414 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Vb Data Import Export

11 New Member
i m using access2003 database for my Project. now i have to import data from another access database with the same table name. can any one please tell me how to import data from another access file using codes.please its urgent
Mar 20 '07 #1
4 1631
Dököll
2,364 Recognized Expert Top Contributor
Use the Update command, I'd have to look, to make sure. Just make sure the table/tables columns you are updating to in one database are also available and in the same sequence in the other. Also, you may consider posting to the Access forum as well, I am not yet an amateur at this, fancy techniques may be found there :-)
Mar 21 '07 #2
vijaydiwakar
579 Contributor
i m using access2003 database for my Project. now i have to import data from another access database with the same table name. can any one please tell me how to import data from another access file using codes.please its urgent
see there are two ways to do so
1. use import facility of Access itself
2. Make two connections one to retrive date and another to insert this data in other database

for that open one recordset create Qry according to ur actual database and insert using connection object
this is the tech. for actual code u've to try it
I'm able to give it 2 u but i think if u do it by urself then it'll uprise ur confidance
bbye 'n take care
Mar 21 '07 #3
rajaaryan44
11 New Member
. i wrote some codes in dao. i created a function : AddTableField

i m writing it in module so that it can be access from anywhere in the program
this is the code

Sub AddTableField(p tdfTableDef As DAO.TableDef, pstrFieldName As String, pintDatatype As Integer, Optional pintSize As Integer, Optional pblnFixedLength As Boolean, Optional pblnAutoIncreme nt As Boolean, Optional pblnAllowZeroLe ngth As Boolean, Optional pblnRequired As Boolean, Optional pstrValidationT ext As String, Optional pstrValidationR ule As String, Optional pvarDefaultValu e As Variant)
Dim fldX As DAO.Field
Dim intSize As Integer

Set fldX = ptdfTableDef.Cr eateField()

fldX.OrdinalPos ition = ptdfTableDef.Fi elds.Count

fldX.Name = pstrFieldName
fldX.Type = pintDatatype

If Not IsMissing(pblnA llowZeroLength) Then
If pintDatatype = dbText And pintSize > 0 Then
fldX.Size = pintSize
Else
fldX.Size = GetFieldSize(pi ntDatatype)
End If
Else
fldX.Size = GetFieldSize(pi ntDatatype)
End If

If fldX.Type = dbLong Then
If pblnAutoIncreme nt = True Then
fldX.Attributes = fldX.Attributes Or dbAutoIncrField
End If
End If

If fldX.Type = dbText Or fldX.Type = dbMemo Then
fldX.AllowZeroL ength = True
End If

If Not IsMissing(pblnR equired) Then
fldX.Required = pblnRequired
End If

If Not IsMissing(pstrV alidationText) Then
fldX.Validation Text = pstrValidationT ext
End If

If Not IsMissing(pstrV alidationRule) Then
fldX.Validation Rule = pstrValidationR ule
End If

If Not IsMissing(pvarD efaultValue) Then
fldX.DefaultVal ue = pvarDefaultValu e
End If

ptdfTableDef.Fi elds.Append fldX

End Sub
.

still i cannot get the transfer done
Mar 23 '07 #4
rajaaryan44
11 New Member
. i wrote some codes in dao. i created a function : AddTableField

i m writing it in module so that it can be access from anywhere in the program
this is the code
Expand|Select|Wrap|Line Numbers
  1. .
  2. Sub AddTableField(ptdfTableDef As DAO.TableDef, pstrFieldName As String, pintDatatype As Integer, Optional pintSize As Integer, Optional pblnFixedLength As Boolean, Optional pblnAutoIncrement As Boolean, Optional pblnAllowZeroLength As Boolean, Optional pblnRequired As Boolean, Optional pstrValidationText As String, Optional pstrValidationRule As String, Optional pvarDefaultValue As Variant)
  3. Dim fldX As DAO.Field
  4. Dim intSize As Integer
  5.  
  6. Set fldX = ptdfTableDef.CreateField()
  7.  
  8. fldX.OrdinalPosition = ptdfTableDef.Fields.Count
  9.  
  10. fldX.Name = pstrFieldName
  11. fldX.Type = pintDatatype
  12.  
  13. If Not IsMissing(pblnAllowZeroLength) Then
  14. If pintDatatype = dbText And pintSize > 0 Then
  15. fldX.Size = pintSize
  16. Else
  17. fldX.Size = GetFieldSize(pintDatatype)
  18. End If
  19. Else
  20. fldX.Size = GetFieldSize(pintDatatype)
  21. End If
  22.  
  23. If fldX.Type = dbLong Then
  24. If pblnAutoIncrement = True Then
  25. fldX.Attributes = fldX.Attributes Or dbAutoIncrField
  26. End If
  27. End If
  28.  
  29. If fldX.Type = dbText Or fldX.Type = dbMemo Then
  30. fldX.AllowZeroLength = True
  31. End If
  32.  
  33. If Not IsMissing(pblnRequired) Then
  34. fldX.Required = pblnRequired
  35. End If
  36.  
  37. If Not IsMissing(pstrValidationText) Then
  38. fldX.ValidationText = pstrValidationText
  39. End If
  40.  
  41. If Not IsMissing(pstrValidationRule) Then
  42. fldX.ValidationRule = pstrValidationRule
  43. End If
  44.  
  45. If Not IsMissing(pvarDefaultValue) Then
  46. fldX.DefaultValue = pvarDefaultValue
  47. End If
  48.  
  49. ptdfTableDef.Fields.Append fldX
  50.  
  51. End Sub
  52.  
.

still i cannot get the transfer done
Mar 23 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
4407
by: rafeekb | last post by:
Hello All, Is there any way to export data in the IXF version 1 format from a DB2 v8.2 database ? The problem I am facing is to get the data from a v8.2 database which produces a version 2 IXF and import it on to a v5.2 database which knows only about version 1 IXF format. Any suggestions, help is much appreciated.
3
2070
by: genojoe | last post by:
I have tried everything I can think of to move records from one Access database to another. It should not be that hard. Read on.... I have identical access mdb's. One contains data; one contains empty tables. From an earlier posting, I was able to move the data by first exporting XML files and then importing them. I would like to find a way to skip the Import/Export steps. I first read the tables into a DataSet from the full...
2
2336
by: David Richards | last post by:
Hi, I was wondering if anyone could help me. I have DataSet that contains the following data tables Customers, Calls, Quotes, QuoteDetails, Competitors, Contacts, Notes, and I have setup relationships betweenthem. Each row in the customer's data table contains an area number. What I would like to do is export all records for specific area to an XML file.
3
4015
by: Iavor Raytchev | last post by:
Hello, We a situation with a central database that contains the data that needs to be presented at N off-line terminals (N can be 5 000 can be 15 000). Each terminal presents unique data. The central database is used for data preparation. Then the data for each terminal is exported as separate SQL file. The terminals run the same application that is used to prepare the data - only in user mode. So what we do is - we export the full database...
20
37903
by: TC | last post by:
I need an automated procedure to copy data from an Access table to a SQL Server table. Speed is important. What is the recommended technique? I can export the data from Access, copy it via FTP, then import it into SQL Server. I've tried that, and the speed is acceptable. It is an ugly solution, however, and I expect to find a better one -- preferably a solution better integrated with the Access RDBMS. I've tried using an ODBC...
10
11831
by: Niklas | last post by:
Hi Before I start coding I need to be sure that nobody else has not done it yet and that I can use it. I need an import utility which import data from Excel to a database or some object in .NET. The data in Excel is not in structured columns but can exist everywhere in the workbook. For example if I am supposed to import a person and all his/her cars which exist in a workbook I want to be able to create an import protocol and specify...
4
4914
by: Max2006 | last post by:
Hi, We are developing a SQL server based asp.net application. As part of requirement we should allow users import/export some relational data through web user interface. We are investigation which file format would be the most efficient format to import export relational data. So far we came up with two options: XML and Access MDB files and we prefer MDB files.
3
7165
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I have a question for you. I have a .csv file which has many lines of data. Each line has many data fields which are delimited by ",". Now I need to extract part of data from this file but save it as an excel file. The data in this excel file will be imported into an Access database. The
2
6641
by: thesti | last post by:
hello, how to programmatically from VB .net / php. to import data from an EXCEL file? is there's no programmatic way, how to automated the process. as i search, the process is: Simply export data from excel as TXT or CSV. Than use MySQL command LOAD DATA INFILE 'path/file.txt' INTO TABLE your_table; so,
11
14442
by: KingKen | last post by:
Database A is distributed across 21 different agencies in a wide geographic area. They all use Access 2007 to run the database. Head office has a copy of database A and would like to have it store all the data from all its outlying agencies. This would require each agency to export the data to a text file and email it to head office. The user at head office would then import this data into the existing database appending all records to its...
0
9690
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10505
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10253
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7576
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5471
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2945
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.