Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Application Programming › Access DB inside VB.NET program?
New Posts  All Forums:Forum Nav:

Access DB inside VB.NET program?

post #1 of 6
Thread Starter 
In school we always use Access DB's in our programs. I was wondering, if I use the Access DB in my program and include it in the installation, if the person uses it on a computer that doesn't have Access will the program still work?
OC Beast
(13 items)
 
  
CPUMotherboardGraphicsRAM
E8500 @4GHZ Gigabyte P45 4850x2 2GB IT LIVES! 4GB 
Hard DriveOptical DriveOSMonitor
500AAKS+250external CD-DVD combo windows 7 ultimate x64 26" 
KeyboardPowerCaseMouse
MC$ wireless 650w corsair antec 900 Logitech battlefield 2142 G5 
  hide details  
Reply
OC Beast
(13 items)
 
  
CPUMotherboardGraphicsRAM
E8500 @4GHZ Gigabyte P45 4850x2 2GB IT LIVES! 4GB 
Hard DriveOptical DriveOSMonitor
500AAKS+250external CD-DVD combo windows 7 ultimate x64 26" 
KeyboardPowerCaseMouse
MC$ wireless 650w corsair antec 900 Logitech battlefield 2142 G5 
  hide details  
Reply
post #2 of 6
Yes its just a file of your data. (As long as you didn't build your program in Access of course)
    
CPUMotherboardGraphicsGraphics
i7-980X (batch#3003B331) Gigabyte X58A-UD7 Sapphire Radeon R9 290 Diamond Radeon HD 5970 
RAMHard DriveOptical DriveOS
24 GB Crucial C300 (256GB SSD) + Seagate XT 7200 2TB LG BH10LS30 (Blueray writer) Windows 7 Professional for Partners 8/18/09 
MonitorKeyboardPowerCase
Samsung 1 x 2493HM 2 x 2494HM Logitech G110 Silverstone Strider ST1500 Cosair 800D 
MouseMouse Pad
Logitech G9 steelseries 
  hide details  
Reply
    
CPUMotherboardGraphicsGraphics
i7-980X (batch#3003B331) Gigabyte X58A-UD7 Sapphire Radeon R9 290 Diamond Radeon HD 5970 
RAMHard DriveOptical DriveOS
24 GB Crucial C300 (256GB SSD) + Seagate XT 7200 2TB LG BH10LS30 (Blueray writer) Windows 7 Professional for Partners 8/18/09 
MonitorKeyboardPowerCase
Samsung 1 x 2493HM 2 x 2494HM Logitech G110 Silverstone Strider ST1500 Cosair 800D 
MouseMouse Pad
Logitech G9 steelseries 
  hide details  
Reply
post #3 of 6
Thread Starter 
ah kk thanks, I was going to do XML files for easy exporting but I need relationships.
OC Beast
(13 items)
 
  
CPUMotherboardGraphicsRAM
E8500 @4GHZ Gigabyte P45 4850x2 2GB IT LIVES! 4GB 
Hard DriveOptical DriveOSMonitor
500AAKS+250external CD-DVD combo windows 7 ultimate x64 26" 
KeyboardPowerCaseMouse
MC$ wireless 650w corsair antec 900 Logitech battlefield 2142 G5 
  hide details  
Reply
OC Beast
(13 items)
 
  
CPUMotherboardGraphicsRAM
E8500 @4GHZ Gigabyte P45 4850x2 2GB IT LIVES! 4GB 
Hard DriveOptical DriveOSMonitor
500AAKS+250external CD-DVD combo windows 7 ultimate x64 26" 
KeyboardPowerCaseMouse
MC$ wireless 650w corsair antec 900 Logitech battlefield 2142 G5 
  hide details  
Reply
post #4 of 6
Quote:
Originally Posted by sparkle128;14441945 
Yes its just a file of your data. (As long as you didn't build your program in Access of course)

No that's incorrect.

You need a driver to connect to a database.

Your client machines probably already have it installed though.
Main System
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom II X6 1090T MSI 890FXA-GD70 XFX Radeon 5850 16 GB Corsair XMS3 DDR3 1333 
Hard DriveOSMonitorPower
3 X 7200 RPM / 1 TB Win 7 Ultimate 64 2 x ASUS 23" VH232H 1080P SeaSonic X-650 
Case
Corsair 600T 
  hide details  
Reply
Main System
(13 items)
 
  
CPUMotherboardGraphicsRAM
Phenom II X6 1090T MSI 890FXA-GD70 XFX Radeon 5850 16 GB Corsair XMS3 DDR3 1333 
Hard DriveOSMonitorPower
3 X 7200 RPM / 1 TB Win 7 Ultimate 64 2 x ASUS 23" VH232H 1080P SeaSonic X-650 
Case
Corsair 600T 
  hide details  
Reply
post #5 of 6
Hard to put things in one message. vb.net has everything you need to work with various type of database. Depending on which version of VB.net you have, 1.1, 2.0, 3.0, 3.5 or 4.0, it all comes with corresponded version of ADO.NET to allow you connect access database, in this case, you usually use oleDB client. I don't have IDE so I just type something else and you need to verify the syntax...

Imports System.Data
Imports System.Data.OleDb
Imports System.Data.OleDb.OleDBClient

Dim cn As OleDbConnection
Dim cmd As OleDbCommand
Dim dr As OleDbDataReader
dim da as OleDbDataAapter
dim dSet as DataSet




' for a typical access database 2003 format.
cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=databasepathhere;Persist Security Info=False")
cn.Open()

' to get fast forward only data
cmd = New OleDbCommand("select * from table1", cn)
dr = cmd.ExecuteReader

dr.read
' then use dr.item(colname or index).value to access data


' to get data so you can process and manipulate locally (disconnect mode)
da=new OleDBDatadapter(cmd)
dSet= new DataSet
da.fill(dSet) ' table data in dSet,
'use DataRow object to access data inside dSet
for each dr as DataRow in dSet.Tables(0).Rows
' your code here

next

' to manipulate data vs. relationship
' use dataraltion object
dim drl as new DataRelation ("rlname","table1colID","tableColID")
Edited by linskingdom - 8/6/11 at 10:58am
post #6 of 6
Thread Starter 
I have programs where I manage data inside of an Access DB, I just wanted to verify that if I published the program and someone without access installed tried to run it, that it would work.
OC Beast
(13 items)
 
  
CPUMotherboardGraphicsRAM
E8500 @4GHZ Gigabyte P45 4850x2 2GB IT LIVES! 4GB 
Hard DriveOptical DriveOSMonitor
500AAKS+250external CD-DVD combo windows 7 ultimate x64 26" 
KeyboardPowerCaseMouse
MC$ wireless 650w corsair antec 900 Logitech battlefield 2142 G5 
  hide details  
Reply
OC Beast
(13 items)
 
  
CPUMotherboardGraphicsRAM
E8500 @4GHZ Gigabyte P45 4850x2 2GB IT LIVES! 4GB 
Hard DriveOptical DriveOSMonitor
500AAKS+250external CD-DVD combo windows 7 ultimate x64 26" 
KeyboardPowerCaseMouse
MC$ wireless 650w corsair antec 900 Logitech battlefield 2142 G5 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Application Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Application Programming › Access DB inside VB.NET program?