Delphi XE and SQL Server 2008 express connection - sql

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.

Related

Delphi 7 BDE on SQL Server 2012

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

Connect to the SQL instance using VB 6.0

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

free sql code editor?

i am breaking my eyes trying to write sql code in ms access. is there a free editor out there?
Microsoft® SQL Server® 2008 Management Studio Express
http://www.microsoft.com/downloads/details.aspx?FamilyID=08E52AC2-1D62-45F6-9A4A-4B76A8564A2B&displaylang=en
MS SQL Code Factory
http://www.sqlmaestro.com/products/mssql/codefactory/
DatabaseSpy SQL Editor
http://www.altova.com/databasespy/sql-editor.html
SQuirrel SQL Client
http://squirrel-sql.sourceforge.net/index.php?page=screenshots
SQL Server Management Studio Express
You should be able to use it as a SQL editor without SQL Server.
I normally use SQuirrel SQL Client to connect to just about any database I need to work with. You can use it with any database you can find a JDBC driver for.
I haven't tried it yet, but I believe they improved the editor in Access 2010 . Here's a post from the Access Blog that discuss IntelliSense.
I didn't see Notepad++ mentioned and of course you get the syntax highlighting but not any intellisense.
I wrote Access SQL Editor, an Add-In for Microsoft Access, because I had the same problem. There is a free 14-day trial here. Purchasing a license is very cheap, but if you can't afford it, you can contact me.
Once it's installed, you can access it through your Add-Ins menu (In Access 2010 it's Database Tools->Add Ins).

Methods to migrate SQL Database (mdf) to SQL Compact Edition (sdf)

I have 4 SQL Server 2005 db's that I want to move to SQL CE. I know I cannot keep the SProcs,Views, and Functions(Differences Between SQL Server Compact and SQL Server) but I would like to keep everything else.
I have tried this app, SQL Server to SQL Server Compact Edition Database Copy but it errors out on me. I have the source and am looking into it but I thought I'd check and make sure I wasn't over complicating the solution to my ACTUAL goal.
Is there a simple, can be one shot, way of converting standard SQL .mdf to SQL CE .sdf?
Right now my best idea is to set up Replication to the SQL CE from the SQL 2005 Standard.
http://erikej.blogspot.com/2010/02/how-to-use-exportsqlce-to-migrate-from.html
1.Use SQL Server to SQL Server Compact Edition Database Copy with sqlcompact 3.1 or 3.0 not sql compact 3.5
You can use a virtual machine like sun virtual box, install sql compact 3 or 3.1 on it, and convert your database inside it
2.You can convert to sql compact manually
Use the SDFViewer utility:
go Tools Menu > From SQL Server
Enough said....
What if you scripted the objects from 2005 and ran the script in CE? That'd give you the structure of the DB, then you could select/insert?
I haven't tried this, but what about SQL's DB export/import tools in management studio?

Get Started with Oracle Express Edition?

I'm novice in oracle.I'm using oracle express 10.2.0 but i don't know how to create my own database and where my database is created.(The path of my new database).
Not to be confused : in Oracle terminology, a database instance (called XE) is automatically created during installation (limitation : there can be only one database instance running at a time in Oracle Express).
What other vendors usually call a database (like in Sql Server) is a Schema in Oracle. To create one, use the CREATE USER command (and not the CREATE SCHEMA command : welcome to the marvelous world of Oracle !), using SQL*Plus or APEX.
I think it's possible to create a database schema through the web administration interface. Check the Getting Started Guide from the Oracle Database 10g Express Edition.
For the path to the files, this article may help: Creating an Oracle (XE) database manually on XP.
Creating a new database is easiest with the web frontend. Look inside the start menu for oracle.
Oracle 10g XE comes with the integrated browser interface. You can access it from http://machine-name:port/xe
It is almost similar to Oracle Enterprise manager. You can also try using Oracle Application Express on it, and develop web applications.