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
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 :-)
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
. 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
. 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(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)
-
Dim fldX As DAO.Field
-
Dim intSize As Integer
-
-
Set fldX = ptdfTableDef.CreateField()
-
-
fldX.OrdinalPosition = ptdfTableDef.Fields.Count
-
-
fldX.Name = pstrFieldName
-
fldX.Type = pintDatatype
-
-
If Not IsMissing(pblnAllowZeroLength) Then
-
If pintDatatype = dbText And pintSize > 0 Then
-
fldX.Size = pintSize
-
Else
-
fldX.Size = GetFieldSize(pintDatatype)
-
End If
-
Else
-
fldX.Size = GetFieldSize(pintDatatype)
-
End If
-
-
If fldX.Type = dbLong Then
-
If pblnAutoIncrement = True Then
-
fldX.Attributes = fldX.Attributes Or dbAutoIncrField
-
End If
-
End If
-
-
If fldX.Type = dbText Or fldX.Type = dbMemo Then
-
fldX.AllowZeroLength = True
-
End If
-
-
If Not IsMissing(pblnRequired) Then
-
fldX.Required = pblnRequired
-
End If
-
-
If Not IsMissing(pstrValidationText) Then
-
fldX.ValidationText = pstrValidationText
-
End If
-
-
If Not IsMissing(pstrValidationRule) Then
-
fldX.ValidationRule = pstrValidationRule
-
End If
-
-
If Not IsMissing(pvarDefaultValue) Then
-
fldX.DefaultValue = pvarDefaultValue
-
End If
-
-
ptdfTableDef.Fields.Append fldX
-
-
End Sub
-
.
still i cannot get the transfer done
Sign in to post your reply or Sign up for a free account.
Similar topics |
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.
|
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...
|
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.
|
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...
|
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...
| |
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...
|
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.
|
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
|
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,
|
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...
|
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...
| |
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...
|
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,...
|
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...
|
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();...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |