🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.basic.visual.misc
Article #501

not able to attach dbf files and access tables

#501
From: vimal.srivastava
Date: Tue, 05 Jan 1999 00:00
54 lines
2454 bytes
hi
I have two problems. I m trying to export data from dbase files to access and
from access to sql server thru a visual basic application
1)When i m attaching a .dbf file to access. Its creating a corresponding
database in place of a table in the microsoft access .(if i open the database
in which i m trying to link i see DB written agains the linked table.

2)when i m trying to attach a access table to sql server i m getting a run
time error "operaion is not supported for this type of object."

i m writing my code here...


Sub attachdatabasemdb_sql()

    Dim dbsCurrent As Database
    Dim tdfRoyalties As TableDef
    Dim rstRemote As Recordset


gDBName = "sbdata2"
gServerName = "devntserver"
gDBO = "sa"
gDBOPassword = "devgmcc"

Set dbsCurrent = OpenDatabase("", Connect:="uid=" & gDBO & ";pwd=" &
gDBOPassword & ";driver={sql server};" _
        & "server=" & gServerName & ";database=" + gDBName + ";")



Set tdfRoyalties = _
    dbsCurrent.CreateTableDef("utils_sql")

    tdfRoyalties.SourceTableName = "utils_mdb"




       tdfRoyalties.Connect = ";DATABASE=c:\newsbdata\newdb.mdb"

    dbsCurrent.TableDefs.Append tdfRoyalties



'utils_mdb is the access table that i m trying to attach to utils_sql

End Sub
anybody can help me out please.......
thanks
vimal

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    
Technical Details
Message-ID: <76tv44$qh8$1@nnrp1.dejanews.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1053fc,23a75d9216aafa20,start
X-Google-Attributes: gid1053fc,public
X-Google-Thread: 10b997,23a75d9216aafa20,start
X-Google-Attributes: gid10b997,public
X-Google-Thread: 11493c,23a75d9216aafa20,start
X-Google-Attributes: gid11493c,public
X-Google-Thread: 110e3b,23a75d9216aafa20,start
X-Google-Attributes: gid110e3b,public
From: vimal.srivastava@unisys.com
Subject: not able to attach dbf files and access tables
Date: 1999/01/05
Message-ID: <76tv44$qh8$1@nnrp1.dejanews.com>
X-Deja-AN: 429123582
X-Http-Proxy: 1.1 x3.dejanews.com:80 (Squid/1.1.22) for client 192.62.223.222
Organization: Deja News - The Leader in Internet Discussion
X-Article-Creation-Date: Tue Jan 05 21:10:30 1999 GMT
Newsgroups: comp.lang.basic.visual.misc,microsoft.public.vb.general.discussion,it.comp.lang.visual-basic,es.comp.lenguajes.visual-basic
X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows NT)