Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

creating a new access 2000 db with a table

Status
Not open for further replies.

Nuqe

Technical User
May 6, 2003
57
CA
I'm trying to create a new db and table, but for some reason I'm getting this error "[Microsoft][ODBC driver manager]datasource name not found and no driver specified"

i click ok then i get the error "runtime error 91" "object variable or with block variable not set"

this is my code so far

Dim catAccess As New adox.Catalog
Dim tblDraft As New adox.Table
Dim cnnAccess As New ADODB.Connection
Dim rstDraft As New ADODB.Recordset

catAccess.Create "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=nhl2003.mdb;Jet OLEDB:Engine Type=4;"
catAccess.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=nhl2003.mdb"

tblDraft.Name = "tblDraft"
tblDraft.Columns.Append ("Num"), adWChar, 10
tblDraft.Columns.Append ("Participant"), adWChar, 25
tblDraft.Columns.Append ("Player"), adLongVarWChar, 400
catAccess.Tables.Append tblDraft

' this is where i get the second error
intRecNum = frmNewDraft.adoDraft.Recordset.RecordCount

any help would be appreciated


nuqe


We all know about the "stupid user" don't we... :)
 
Make sure MDAC 2.5 was installed (for starters, see if ADO 2.5 is avaiable under PROJECT|REFERENCES)

Remove this line
catAccess.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=nhl2003.mdb"

adoDraft appears to be a data control. What is it's record source and connection set to? If it is set to the same mdb and table just created, you will need to refresh.
 
Hey,

The data control is attached to another database already made... so there should be no problem there. this MDAC 2.5 in the refrences, is that "Microsoft DAO 2.5 compatibility library" by any chance??

thanks



We all know about the "stupid user" don't we... :)
 


Hi Nuge

Look for "Microsoft ActiveX Data Objects 2.5 Library" in the references list.

Cassie
 
hey Cassie

i have a reference, but its to a 2.0 library instead of a 2.5, does that matter??
thanks
NUQE

We all know about the "stupid user" don't we... :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top