How I can connect to the SQL instance using SMO with VB6.0?
I don't think you can because Microsoft.SqlServer.Smo.dll is not an ActiveX DLL, but depending on what it is you want to do you may be able to accomplish it using SQLDMO. Unfortunately Microsoft is ending support for SQLDMO after SQL 2008. You can read more at http://msdn.microsoft.com/en-us/library/ms141187%28SQL.100%29.aspx
Related
I'm trying to get data from api and insert them into a SQL Server .sdf database file, but I'm not sure how to do it especially that I'm using Windows forms on Visual Studio 2010
Can someone help me ?
This is a very broad question, however, at a very high level, you will need to open up a connection to the SQL Server Database and use a data access technology such as ADO.NET or EntityFramework to work with the objects in the database.
See the answer in this thread for an example of working with ADO.NET.
Searched the net in and out and could not find proper info on that, we have a legacy setup that uses Delphi 7 and BDE to connect to SQL Server 2005.
Now we are planning to migrate to SQL Server 2012, what are the chances that it might work or not?
If you are using the SQL Links MSSQL driver then targeting SQL Server 2012 will not be possible. The only way that I have been able to use SQL Links with anything newer than SQL Server 2000 is to keep the database compatibility level set to "SQL Server 2000 (80)". This is not possible in SQL Server 2012. The oldest compatibility level available in this version is "SQL Server 2005 (90)".
SQL Links will send invalid SQL to the server, such as the "*=" syntax for an outer join. Databases set for SQL Server 2005 and above will not accept this syntax.
We've been using Delphi 7 with SQL Server 2012 without significant issue via the Delphi 7 ADO data control components (e.g. TAdoQuery, TAdoCommand). Stored procedures also work fine, and functions can be called via ADO commands objects (TAdoCommand).
We use the SQL Server Native Client 11.0 ODBC driver that comes with SQL Server 2012. Delphi just treats it as another ODBC data interface. Superficially it looks a lot like using MS Access with Delphi 7 (via ADO components and Access OLE driver). No issue with any of the Service Pack(s?) for SQL Server 2012 either. (Sorry, I don't remember exactly what SP's are released for 2012, but we've had no differences w/ or w/o these SP's, and we tested for it).
Most of the development was done on Windows 7 64-bit OS's, and executed on same as well as Windows Server 2008 and 2008R2, both 64-bit. No special settings were required to execute Delphi-compiled executables (which are all 32-bit, obviously).
If you use ODBC "aliases", be sure to use the 32-bit ODBC DSNs, not the 64-bit ODBC DSNs. The 64-bit ODBC Administrator is the one in the Control Panel\Administrative Tools for 64-bit Windows - don't use it here. Use the 32-bit ODBC Administrator, in Windows' SysWOW64: C:\Windows\SysWOW64\odbcad32.exe. The 64-bit ODBC DSNs live in a separate space from the 32-bit DSNs. Delphi 7 is a 32-bit application and won't have access to the 64-bit DSNs (different API I'm guessing).
We may also have had an issue with comments in SQL statements. I think the line comments ("--") didn't work, but multi-line comments worked ("/.../").
Note that while the BDE is preserved by Corel (distributed to this day as the Paradox Runtime; the engine is frozen, however, and does have some issues in modern Windows OS's), it's not needed to access SQL Server data. We use the ODBC aliases directly through the Windows ODBC API (we wrote wrappers in Delphi to make this trivial). However, you can still use the BDE as an interface to these ODBC DSN aliases. If you don't use aliases at all (and don't include any references to DbTables.pas in the source code) you shouldn't need the BDE at all. DbTables.pas initialises the BDE always when it initialises the global Sessions variable in its INTIALIZATION block. You can see this in the bottom of the DbTables.pas source code unit. Without this unit, the BDE isn't initialised or used. (Which also means you cannot use TTable or TQuery components, but those are only for Paradox data; the ADO components like TAdoTable (don't use it unless you want to load the entire data table into memory!), TAdoQuery or TAdoCommand are entirely independent.
Another trick is to use MS Access databases and linked tables to interface between SQL Server and Paradox data tables, if you still need to use BDE-native (i.e. Paradox) tables. But sometimes Access and the BDE don't play well together.
The migration is long done, I'm sure, but in case others are searching for the same answer. Legacy software has a habit of living on...
We've had success using BDE with SQL Server 2008R2. No special config.
Edit: I'm also having initial success on SQL Server 2014 today. Limited testing, but so far so good!
Greg
I've been experimenting with Mango's new data libraries (System.Data.Linq) but I've never used Linq to SQL before and all of my existing code is written for SQLite with ADO.NET. Is there any way (via referencing a Silverlight DLL or otherwise, that I can just write the SQL myself or am I forced to use Linq if I want to use SQL Server CE?
The only way to use SQL Server CE on Windows Phone 7 is via Linq.
There is now way to use SQL that you write yourself.
How can I connect Delphi and SQL Server 2008?
I found on the internet a tutorial teaching how to use SQLConnection.
The problem is that Delphi doesn't give me an option to select MSSQL, only Interbase/Firebird and MySql.
Is there any driver missing?
I know we can use a component like Devart but I just want to use what Delphi XE offers.
If you have Delphi XE Architect or Enterprise, you should be able to connect with TSQLConnection. Since you don't see that, I'm guessing you have the Professional SKU.
You can use ADO via TADOConnection, TADOCommand and TADOQuery to work with SQL Server in XE Pro. You'll find them on the dbGo tab in the component palette.
I use vb.net and windows form and sqlserver
I added Data Source(Microsoft SQL Server (SqlClient)) to my project. and now I need to change it to ODBC Data Source .
How Can I do That?
thanks
See these resources - you cannot simply change your SqlClient/SqlCOnnection - you need to use OdbcConnection instead:
Connecting to an ODBC Data Source Using ADO.NET
ADO.NET ODBC connection in VB.NET
ODBC is a technology several generations older than ADO.NET/SqlClient - why do you want to "downgrade" back into the dark ages?? What are you trying to achieve that you cannot do using SqlClient?? If you really must connect to a multitude of different datasources, I would strongly recommend using / investigating OleDB instead of ODBC. ODBC is really quite old, and e.g. doesn't have any 64-bit capable drivers.... OleDB does!
See the Wikipedia article on OleDB, and view impressive lists of OleDB data providers here and here for some insights.