Maartin
Nov 14th, 2000, 04:20 AM
Hi all,
I need some help, I want to create a table in MSSQL 7.0 using VB6 with DAO and ODBC. I used a declaration of connection and when I try to go about creating the TableDef I keep on getting and error 'Object not supported for this type object.
I tried various ways but no luck.
Here is a snipet of the db open and the the create attempt:
'|Db decl
Dim wrkMain As Workspace
Dim dbMain As Connection
Dim rsMain As Recordset
'|Connect
Set wrkMain = CreateWorkspace("Transfers", "", "", bUseODBC)
Set dbMain = wrkMain.OpenConnection("Transfers",dbDriverComplete,False,"ODBC;DATABASE=Emmadb;UID=sa;PWD=;DSN=EmmaDB")
'|create table
Dim tblDef As TableDef
Dim prpLoop As Property
Dim dbTemp As Database
Set dbTemp = dbMain.Database
Set tblDef = dbTemp.CreateTableDef("Transfer_Hist") OR
Set tblDef = dbMain.Database.CreateTableDef("Transfer_Hist")
Both the last lines of code give the same error, anybody got ideas or suggestions ?
Thanks.
Maartin.
I need some help, I want to create a table in MSSQL 7.0 using VB6 with DAO and ODBC. I used a declaration of connection and when I try to go about creating the TableDef I keep on getting and error 'Object not supported for this type object.
I tried various ways but no luck.
Here is a snipet of the db open and the the create attempt:
'|Db decl
Dim wrkMain As Workspace
Dim dbMain As Connection
Dim rsMain As Recordset
'|Connect
Set wrkMain = CreateWorkspace("Transfers", "", "", bUseODBC)
Set dbMain = wrkMain.OpenConnection("Transfers",dbDriverComplete,False,"ODBC;DATABASE=Emmadb;UID=sa;PWD=;DSN=EmmaDB")
'|create table
Dim tblDef As TableDef
Dim prpLoop As Property
Dim dbTemp As Database
Set dbTemp = dbMain.Database
Set tblDef = dbTemp.CreateTableDef("Transfer_Hist") OR
Set tblDef = dbMain.Database.CreateTableDef("Transfer_Hist")
Both the last lines of code give the same error, anybody got ideas or suggestions ?
Thanks.
Maartin.