473,406 Members | 2,259 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Programming a Database without Objects

I am learning how to do database programming in VB.Net. I would like to know
how to connect to a database programmicly(not sure if thats a word :) instead
of using the connection/data adaptor/dataset objects. I've figured out how to
move trought the database using typed and untyped commands but I'm still not
able to connect to the database without the oleDBconnection object to get the
connection string. The connection string I'm using is:

myconnection.connectionstring = Jet OLEDB:Global Partial Bulk Ops=2;Jet
OLEDB:Registry Path=;Jet OLEDB:Database Locking Mode=1;Data
Source="C:\Documents and Settings\moorem\Desktop\db1.mdb";Mode=Share Deny
None;Jet OLEDB:Engine Type=5;Provider="Microsoft.Jet.OLEDB.4.0";Jet
OLEDB:System database=;Jet OLEDB:SFP=False;persist security
info=False;Extended Properties=;Jet OLEDB:Compact Without Replica
Repair=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Create System
Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;User ID=Admin;Jet
OLEDB:Global Bulk Transactions=1

This string was created using the oleDBconnection string wizard....thingy.
(A trick I learned in VB 6.

Any help with this would be greatly appreciated.

Thanks
Mole
Nov 21 '05 #1
1 1371
dim s_ConnectionString = "your connection string here"
dim dbConnection as new OleDB.OleDbConnection(s_ConnectionString)
dim cmdSelect as new OleDB.OleDbCommand("SELECT COUNT(*) FROM TABLE")

dbConnection.Open

cmdSelect.executeScaler() ' execute the SQL command

dbConnection.Close
for example
dim dbConnection as new OleDB.OleDBConnection(connectionString)
"molemoore" <mo*******@discussions.microsoft.com> wrote in message
news:89**********************************@microsof t.com...
I am learning how to do database programming in VB.Net. I would like to
know
how to connect to a database programmicly(not sure if thats a word :)
instead
of using the connection/data adaptor/dataset objects. I've figured out how
to
move trought the database using typed and untyped commands but I'm still
not
able to connect to the database without the oleDBconnection object to get
the
connection string. The connection string I'm using is:

myconnection.connectionstring = Jet OLEDB:Global Partial Bulk Ops=2;Jet
OLEDB:Registry Path=;Jet OLEDB:Database Locking Mode=1;Data
Source="C:\Documents and Settings\moorem\Desktop\db1.mdb";Mode=Share Deny
None;Jet OLEDB:Engine Type=5;Provider="Microsoft.Jet.OLEDB.4.0";Jet
OLEDB:System database=;Jet OLEDB:SFP=False;persist security
info=False;Extended Properties=;Jet OLEDB:Compact Without Replica
Repair=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Create System
Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;User
ID=Admin;Jet
OLEDB:Global Bulk Transactions=1

This string was created using the oleDBconnection string wizard....thingy.
(A trick I learned in VB 6.

Any help with this would be greatly appreciated.

Thanks
Mole

Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

52
by: Tony Marston | last post by:
Several months ago I started a thread with the title "What is/is not considered to be good OO programming" which started a long and interesting discussion. I have condensed the arguments into a...
1
by: Bo Xu | last post by:
Object of Combination By Bo Xu Introduction A combination of n things, taken s at a time, often referred as an s-combination out of n, is a way to select a subset of size s from a given set of...
21
by: Jon Slaughter | last post by:
I have a class that is basicaly duplicated throughout several files with only members names changing according to the class name yet with virtually the exact same coding going on. e.g. class...
2
by: Ed_P | last post by:
Hello I just wanted to get the opinions of those of you who have experience developing C# applications and programming in general. I currently am learning the basics of programming (choosing C#...
3
by: Alan | last post by:
I am coming from other programming tools field, and new to VB .NET. Just wondering what is the common approaching in database programming in VB .NET? 1) Are you guru always using the data aware...
6
by: lennon1 | last post by:
Hi, I have already started learning .NET and I have a question. If I want to do anything - Display Data, Navigate, Update - with database (SQL Server) in Visual Studio 2005, do I have to use all...
9
by: eholz1 | last post by:
Hello PHP group, I looks like this is a good forum to ask my question. I am using both PHP and MySQL. I would like/am designing a photo database for the web - not heavy duty - not complex,...
9
by: Peter Duniho | last post by:
Is there a straightfoward API in .NET that allows for inspection of a database? That is, to look at the structure of the database, without knowing anything in advance about it? For example,...
43
by: Adem24 | last post by:
The World Joint Programming Language Standardization Committe (WJPLSC) hereby proclaims to the people of the world that a new programming language is needed for the benefit of the whole mankind in...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.