ODBC Error on Database Open lazarus / 16-Databases ---------------------------------------------------------------------- spitofland · 2010-05-04 20:23 I am trying to connect to a database on 64-bit Windows 7 through ODBC using Lazarus 0.9.28.2 and MS SQL Server 2008. I input the data manually (as in the attached image) and I also used a DSN File as another test. Both tests gave the same error as shown in the image. I tried using the debugging tools to step into the 'Open' procedure so that I could see what this function does. This did not work and I was unable to find the definition of the procedure (only the declaration). Does anyone know what could be causing this error? More importantly, does anyone have any ideas how to fix this error? ---------------------------------------------------------------------- paweld · 2010-05-04 20:44 try: Code: [Select]with aODBCConn do     begin       KeepConnection:=false;       LoginPrompt:=false;       Driver := 'SQL Server';       Params.Add('Server=SERVER_NAME');       Params.Add('Database=DATABASE_NAME');       Params.Add('User Id=USER_NAME');       Params.Add('Password=PASSWORD');       Connected:=true;     end; Best regards paweld ---------------------------------------------------------------------- spitofland · 2010-05-04 20:56 Should the database name be the file with the database or the title of the database on the server? Also, should the server name be 'localhost' (it is on this machine) or should it be the MSSQLSERVER2008 (the name of the server)? ---------------------------------------------------------------------- paweld · 2010-05-05 04:16 DATABASE_NAME=title of the database on the server SERVER_NAME=if localhost and instance is default then '(local)' or '.' [if tcp/ip protocol enabled]; if localhost and instance is not default then '(local)\INSTANCE_NAME' or '.\INSTANCE_NAME'; if another computer then 'COMPUTER_NAME' or 'COMPUTER_IP_ADDRESS' + possibly INSTANCE_NAME e.g. localhost, database 'test' (Code: [Select]CREATE DATABASE TEST) Code: [Select]with aODBCConn do     begin       KeepConnection:=false;       LoginPrompt:=false;       Driver := 'SQL Server';       Params.Add('Server=(local)');       Params.Add('Database=test');       Params.Add('User Id=sa');       Params.Add('Password=123');       Connected:=true;     end; Best regards paweld ---------------------------------------------------------------------- spitofland · 2010-05-05 12:01 I'm still getting the same error "Project project1.exe raised exception class 'External: SIGSEGV'." Has anyone successfully used ODBC with 64-bit FPC 2.2.4? ---------------------------------------------------------------------- spitofland · 2010-05-05 12:26 I just tried running the exe outside of lazarus and got an Access Violation. I've tried 'Server=(local)', 'Server=.', 'Server=(local)\SERVERNAME', 'Server=.\SERVERNAME', and even 'Server=COMPUTER\SERVERNAME'. All of these give the same error when I run 'Connected=true;'. The user id and password are correct, so are the database name and the driver. Could this be a dll error since I'm using 64-bit? I really don't know what causes an Access Violation. ---------------------------------------------------------------------- spitofland · 2010-05-05 17:55 I finally got it working! I installed the snapshot Lazarus-0.9.29-25142-fpc-2.4.1-20100503-win64.exe and used the graphical interface to place a button and a TODBCConnection on the form. I entered the fileDSN, the user ID, and the password into the TODBCConnection using the Object Inspector and that did it. Now the connection opens and I can work with it. I still could not get this to work with fpc 2.2.4, but the snapshot seems to work. ---------------------------------------------------------------------- Wodzu · 2010-05-06 05:43 I think that you should not afraid of using snaapshots despite the fact that some older releases are marked as "stable". From my experience if something doesn't work trying a newer snapshot is a must. ---------------------------------------------------------------------- tiberi72 · 2011-02-15 10:35 Hello, I have the same problem On ODBC 32 bit, but I am new. I have istalled Lazarus 0.9.28.2 beta fpc 2.2.4 How can I upgrade lazarus and fpc to your version?