Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Database > SQL Language
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 7th, 2009, 07:53 AM
Authorized User
 
Join Date: Dec 2008
Posts: 18
Thanks: 1
Thanked 0 Times in 0 Posts
Red face .mdb to SQL

I've an .mdb file(its an access DB)...i dnt 've access installed in my sys...i need to convert this file into some readable format.......i'm not planning to use the DB....is there any way it cud b done......thanks
__________________
Yamini
Reply With Quote
  #2 (permalink)  
Old January 7th, 2009, 05:21 PM
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

There are a handful of things you could do. You could write a little VBScript ".vbs" file that would convert the ".mdb" to CSV (Comma Separated Value) format, for instance.

But what operating system are you using?
Reply With Quote
  #3 (permalink)  
Old January 8th, 2009, 12:40 AM
Authorized User
 
Join Date: Dec 2008
Posts: 18
Thanks: 1
Thanked 0 Times in 0 Posts
Default

I'm working on a XP2 SP3 .. programming using vs2008/c#....n 've never in my life worked in VB script..can it be done any other way ..thanks
__________________
Yamini
Reply With Quote
  #4 (permalink)  
Old January 8th, 2009, 01:43 AM
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

Oh, sure! You could easily create either a C# standalone program or a C#-base ASP.NET web page to do this!

You just have to use the right connection string to hit the Access ".mdb" file.

Look in your docs for the namespace "System.Data.OleDb"

For example:
http://msdn.microsoft.com/en-us/libr...onnection.aspx

Something as simple as:
Code:
String connString      "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\myPath\myJet.mdb;"
OleDbConnection conn = new OleDbConnection(connString)
...
If you don't know the names of the tables and/or fields, you can use the GetSchema method on that class to find them.

http://msdn.microsoft.com/en-us/library/system.data.oledb.oledbconnection.getschema(VS.80) .aspx

But you know, if you are using VS2008, you should be able to just ask VS to create a connection to the ".mdb" database for you and then it will automatically give you access to all its tables and fields.

Just for example, I used Visual Web Developer 2005 (just now) to find and connect to a ".mdb" database I had lying around and it took maybe 20 seconds, tops. Not sure if the names of things are the same as in VS2008, but something like this:
-- Click on TOOLS menu
-- Click on CONNECT TO DATABASE
-- In the ADD CONNECTION dialog, choose DATA SOURCE "Microsoft Access Database File (OLE DB)" [if that's not already the default]
-- Browse to find the ".mdb" file you want to connect to
-- Enter Username and password if applicable (many ".mdb" files are not password protected, in which case leave both fields blank)
-- Click "Test Connection"
-- If all works, just say OK

Now go to DATABASE EXPLORERE and DATA CONNECTIONS VIEW.
Find the database you just made the connection to and click on it.
There you'll see TABLES and VIEWS. Click on any table to see the fields in it. VIEWS shown are actually "stored queries" in Access; I can't find any way to see the textual SQL form of those queries, so that might be the big stumbling block if you find you must have that SQL.

Last edited by Old Pedant; January 8th, 2009 at 01:56 AM..
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
import data from mdb to another mdb mat41 Classic ASP Professional 3 March 9th, 2007 07:01 AM
MS Access .mdb calling SQL server 2000 stored proc fazzou Access 6 September 8th, 2006 11:32 AM
Access MDB with SQL Backend ashg657 Access 2 July 18th, 2006 12:54 PM
Access MDB with a Linked SQL Server Table..... timmaher Classic ASP Databases 0 September 28th, 2005 03:57 AM



All times are GMT -4. The time now is 07:52 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.