Link to home
Start Free TrialLog in
Avatar of ahpui
ahpui

asked on

How to convert ADO.rs.field.type to DAO.rs.field.type?

Hi,

I need to create mdb files on the fly with data from SQL server. I'll be getting data through ADODB.rs. When I try to create mdb file using the following syntex:

Set dbDatabase = CreateDatabase(sNewDBPathAndName, dbLangGeneral, dbEncrypt)

For Each fld In rs.Fields
    Set fldArray(i) = tdLogTable.CreateField(fld.Name, fld.Type, fld.DefinedSize)
    i = i + 1
Next

the program error out at the table.CreateField method. The "fld.Type" returns an ADODB.rs.field type which can't be recognized by the CreateField method. Can anyone show me how to solve this? Thanks in advance!
ASKER CERTIFIED SOLUTION
Avatar of rkot2000
rkot2000

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ahpui
ahpui

ASKER

Thanks! It works after a minor modification.