Problems connecting to SQL Server lazarus / 16-Databases ---------------------------------------------------------------------- LDBrown · 2011-03-17 15:04 Hello, I'm new to Lazarus (but not object pascal) and am experiencing problems connecting to a Microsoft SQL Server database. I'm attempting to use a TODBCConnection to establish the connection. I set it up by following the layout of the MSSQL section of the database tutorial on the wiki. The code compiles and runs with no problems, but when checking the datasets property of the connection I get a 0. My plan was to hook a TDataSource to my connection (using the .dataset property) to hold the table I am trying to access. Am I going about this the wrong way? I need to post updates to a table in the database I appear to be connected to. Currently running Win7 Enterprise, Lazarus v 0.9.28.2 beta, SQL Server 2008 Thanks in advance for your help. ---------------------------------------------------------------------- Lacak2 · 2011-03-18 06:25 Do you mean, you use ODBCConnection1.DataSetCount property ? And 0 is returned ? ---------------------------------------------------------------------- LDBrown · 2011-03-18 17:37 Yes, that's correct. Also, when checking ODBCConnection1.connected I get -1. ---------------------------------------------------------------------- Lacak2 · 2011-03-21 11:15 You must have TODBCConnection object for example ODBCConnection1  and TSQLQuery object for example SQLQuery1 with SQLQuery1.Database set to ODBCConnection1 ... then ODBCConnection.DataSetCount should be = 1 ...