Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 24th, 2003, 08:47 AM
macrado macrado is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 64 macrado User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 12 h 11 m 38 sec
Reputation Power: 5
Question Database Object Not Defined???

I have done a few applications using databases, so I am familiar with using them...however, I recently installed visual basic at a new computer, and now when I try to create a database object the weirdest thing happens...

When you create a new variable, Visual Basic brings up a list of recognized data types....but when I do:

Dim db as Database

Database is not a recognized data type...ie, it's not in the popup list of data types. Just to try, I left the statement above as you see it now. I tried running the program, only to get this error:

Compile Error:
User-defined type not defined

What do I need to do in order to get visual basic to recognize the database type (as well as the recordset type)?
__________________
~~Macrado~~

Reply With Quote
  #2  
Old December 24th, 2003, 01:01 PM
Fisherman's Avatar
Fisherman Fisherman is offline
Inherits Programmer.Slacker
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Aug 2003
Location: Between my Id and your Ego
Posts: 2,179 Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level)Fisherman User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 10 h 3 sec
Reputation Power: 111
Send a message via ICQ to Fisherman Send a message via AIM to Fisherman
Re: Database Object Not Defined???

well, in VB, you use several objects to access database tables/stored procedures, and the like. The central object is obviously the recordset, as it holds the data. The recordset also has several properties and methods that allow for different variations, such as SQL Statements, Dynamic recordsets, lock types, and the like. To actually get to the database, however, you must have a Connection object, which is defined in the ADODB library. You declare it as

Code:
dim cnConnection as new ADODB.Connection


The connection object is VB's way of keeping the source of the data and the actual data disconnected to create a more object-oriented design for ADODB. You must include a project reference to the ADODB library in Project->references in the menus at the top of the VB IDE.
__________________
Fisherman

"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." - A.Einstein

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Database Object Not Defined???


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT