.NET

Reply
Contributor
Eycki
Posts: 18
Registered: ‎05-24-2011
Message 11 of 20 (1,733 Views)

Re: 32bit AND 64bit environment database connectivity

11-22-2011 07:08 AM in reply to: Rob.O

You are right. Mine got accidently working after I compiled the project on a 32-bit computer.  It was only working after the build. Inside VisualStudio itself I could not connect to the databse.  But now I did found the solution.

 

Installing the "Microsoft Access Database Engine 2010 Redistributable", followed by the "2007 Office System Driver: Data Connectivity Components" solved the problem for me!

 

When VisualStudio is debugging it wants the 32-bit version of the ACE.OLEDB.12.0 provider, so you need both of them on your computer.  When you stop debugging you get back into VisualStudio and the Database will look like disconnected again. Just refresh and he finds the right OLEDB provider. Some said it is not possible, but it does!

 

It's written on the forum below what steps you have to follow.

 

http://social.msdn.microsoft.com/Forums/en-NZ/sqldataaccess/thread/c371fb35-6bdd-42e6-b88e-d1c0003d2...

Valued Contributor
ognyandim
Posts: 59
Registered: ‎05-21-2008
Message 12 of 20 (1,700 Views)

Re: 32bit AND 64bit environment database connectivity

11-25-2011 03:11 AM in reply to: Rob

I agree with norman - go to SQL Server ( but add a little bit of ADO.NET for completness ).

 

We have lots of DB-Acad-.XSLx-CSV-and-you-name-it work plus x86 and x64 AutoCADs (even 32bit Acad on 64bit comp.) on different machines plus legacy code (!). If you add to the .NET-SQL tandem a little bit of ADO.NET 4 you are on the right direction.

From ADO.NET we get data from DWGs then we sort and consolidate and then we export to whatever we want ( ADO.NET has data providers for almost everything).

 

My choice after working for some years with MySQL+ODBC+ACAD is MSSQL+.NET+ADO.NET+OpenXML+ACAD.

 

Explore this link http://msdn.microsoft.com/en-us/library/ms971485.aspx for ADO.NET to Access.

New Member
plonga
Posts: 1
Registered: ‎12-16-2011
Message 13 of 20 (1,667 Views)

Re: 32bit AND 64bit environment database connectivity

12-16-2011 07:36 AM in reply to: ognyandim

I haven't read all the postings in detail, but I found a way to install 64Bit ACE Engine on systems with 32 Bit Office.

 

Download AccessDatabaseEngine_x64.exe http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=13255 

And install it via Command Line with:

> AccessDatabaseEngine_x64.exe \passive

 

Now you should be able to connect to Access DB Files even though it is 32 Bit and your environment is 64 Bit.

Valued Contributor
MRiemenCAD
Posts: 65
Registered: ‎03-31-2003
Message 14 of 20 (1,617 Views)

Re: 32bit AND 64bit environment database connectivity

01-12-2012 08:31 AM in reply to: norman.yuan

Just wanted to let you know that your repsonce here was very helpful to me too. I've been struggling with a suite of Access databases used over the past 10 years and now moving to .net to connect both 32bit and 64bit Acad to them. It's time to update the DB's before i can move forward. Again, appreicate your thoughtfull responce.

 

cheers.

Valued Contributor
tanerpro
Posts: 83
Registered: ‎10-07-2005
Message 15 of 20 (1,148 Views)

Re: 32bit AND 64bit environment database connectivity

05-27-2013 06:08 AM in reply to: Rob

Has anyone found a solution and tell me how to do? I have read hundreds of pages but have nothing.

I want to read excel files with the connection string        

 

connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;" & _
                       "Data Source=" & FileName & ";" & _
                       "Extended Properties=""Excel 12.0;HDR=YES;IMEX=1;"""

 

I am using Windows 7 64 bit, Autocad 2012 64 bit, Office 2010 32 bit.

If not an Autocad dll, I can change target cpu to X86 and it works, but for Autocad it has to be X64, and I can't install 64 bit Jet since Office is 32 bit. There is no way i can do this.

Windows 7 (x64)
AutoCAD 2012 (x64)
*Expert Elite*
norman.yuan
Posts: 1,002
Registered: ‎04-27-2009
Message 16 of 20 (1,139 Views)

Re: 32bit AND 64bit environment database connectivity

05-27-2013 06:58 AM in reply to: tanerpro

Although you said "it is no way I can do this", have you tried to install MS Access Engine 64blt, as suggested by plonga's reply? AFAIK, one can install 64-bit MS Access Engine with MS Office 2010 32-bit in the same computer (it is not possible if you use MS Office 2007). But you may have to uninstall MS Office first, then install the MS Access Engine 64-bit and reinstall MS Office 32-bit. You may read more on this topic by searching the web. Bottom line is, for your code shown here to work, you must install MS Access engine 64-bit, because your AutoCAD is 64-bit. It can be done. But I'd not suggest it is good solution in most cases. Read on.

 

On the other hand you can easily to have a solution (maybe a better sotion for your specific need) to get around the 64-bit MS Access Engine issue:

 

  •  Do you really need to store data in Excel worksheet format? If the *.xlsx file is only for storing data, not the presentation format, while you still prefer to be able to open the data file in Excel, you can consider to save the data as *.csv format, which is comma delimited text data string and can be read/written from/to by code very fast, and can be open in Excel.
  •  If you want to keep the presention format in Excel, you can consider to use Open Xml, which is designed to access MS Office document (*.docx, *.xlsx) without the need of installing MS Office (Word, Excel), to access data stored in *.xlsx file.
  •  if the data is shared office-wide/by multiple users, consider to place data in a sutale database system (SQL Server, SQL Server Express...). Just the facotr that you need to install MS Acess Engine 64-bit in every computer that may run your code along may lead you to give it up.
Valued Contributor
jaboone
Posts: 91
Registered: ‎12-05-2011
Message 17 of 20 (1,119 Views)

Re: 32bit AND 64bit environment database connectivity

05-29-2013 07:59 AM in reply to: norman.yuan

I have been forced to research SQL server lately since I have a database Licensing program I am trying to work with.  I am having a hell of a time wrapping my head around how to set up a server for a specific file so it can be accessed from an external program.  It happens to be named LicenseService.mdb  My program has to add and manipulate data within that file, which happens to be on the internet.

 

Since it is named as an mdb, does this mean that SQl can not open or manipulate it?  Does simply installing MS SQL automatically set up my server, since my licensing program has to make a SQL command.  I don't understand how this whole thing  works.

When setting up a "server", How do I do that and what would those names be?

Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;

 

I investigated servers but don't know how to set them up for calling connections strings.  Not sure I have a 'server'.

Is the configuration manager on the right track or do I not get the picture?

Learning as I go
*Expert Elite*
norman.yuan
Posts: 1,002
Registered: ‎04-27-2009
Message 18 of 20 (1,109 Views)

Re: 32bit AND 64bit environment database connectivity

05-29-2013 09:33 AM in reply to: jaboone

*.MDF file is just data file holding data for particular database hosted by a SQL Server. your application/code never deals with it (except for attaching it to a SQL Server, if the code is for SQL Server database setup).

 

For your applicatioon (AutoCAD addin, right?) to access data in a database hosted by a SQL Server, you need to have a SQL Server and a database hosted iin the SQL Server reachable in the network (intranet, usually, or the same computer). If the SQL Server is hosted on the Internet, well, technically, it can be allowed to be accessed to directly via the Internet, but no one in his right mind will open the database's door wide to the Internet. To assess data via the Internet, you need to build a web application and/or a web service application, and hide the SQL Server/database behind (e.g. the web application/services will be accessing the database when your user uses the web application/services). It is quite complicated when the Internet is involved.

 

If your users live inside a corporate network, you can then have your AutoCAD addins dirrectly access the SQL Server/database, although a middle layer of data access would be the best practice.

 

My feel is, if your solutioon is baed on data hosted in the Internet, you need to find help from someone who knows how to do web applications/services, or you need to learn a lot before doing the solution. Never try to connect SQL Server via the Internet (you'll never get through the connection, unless you host it yourself and make it wide open to the net).

 

Or, you may start with installing/hosting SQL Server in the LAN or your own computer and learn more. When you are comfortable with data access technology with SQL Server (or any other database server, foe that matter), you can then look into moving the data into the web. I am sure you know SQL Server Express is free. you can install it in your computer and start from there.

 

*Expert Elite*
dgorsman
Posts: 5,408
Registered: ‎10-12-2006
Message 19 of 20 (1,107 Views)

Re: 32bit AND 64bit environment database connectivity

05-29-2013 09:34 AM in reply to: jaboone

Pardon if you already know all this, if so maybe it will help others moving to the deep end of the pool.

 

SQL Server doesn't use "files" per se, at least not how Access or SQLite uses them.  You run SQL Server on a server, which then allows for the creation of databases and contained tables, queries, and other database-related information.  When establishing a connection, its similar to conneccting to an Access database (file), except instead of specifying a file you specify a server which is running the SQL Server program.

 

SQL Server set up and management is a very complex topic, to the point where its practical for people to specialize in nothing *but* that.  If you don't have one of those specialists on staff, bringing in a consultant will be worth the cost.

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
Adopt. Adapt. Overcome. Or be overcome.
A good question will be halfway to a good answer.


Valued Contributor
jaboone
Posts: 91
Registered: ‎12-05-2011
Message 20 of 20 (1,107 Views)

Re: 32bit AND 64bit environment database connectivity

05-29-2013 09:55 AM in reply to: dgorsman

I am with you and thanks for your very usefull information.  I am new to accessing data, but the applications I have builds a web application (ASP) which I have to password protect beyond a point.  Yes the datafile is hidden from direct access, but your feedback tells me I have to look closer at the hosting service to get them to provide a sql server so I can write to the database, I believe is what I am hearing, instead on my local machine.

 

Thanks very much for the explainattion.

Learning as I go
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.