Thread View: comp.lang.basic.visual.misc
1 messages
1 total messages
Started by vimal.srivastava
Tue, 05 Jan 1999 00:00
not able to attach dbf files and access tables
Author: vimal.srivastava
Date: Tue, 05 Jan 1999 00:00
Date: Tue, 05 Jan 1999 00:00
54 lines
2454 bytes
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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads