how can we transfer data from one access database to another databse . the table name is same for both the database . in one table some records are there (rs say e.g.) now another table has say rs+10 records . now i have to pass there 10 values to another table with same name . can anyone help me with this. i m usinf DAO
. 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(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
Comment