<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[My Visual Database — please help,  Can the project be connect with Microsoft sql server?]]></title>
		<link>https://myvisualdatabase.com/forum/viewtopic.php?id=7098</link>
		<atom:link href="https://myvisualdatabase.com/forum/extern.php?action=feed&amp;tid=7098&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in please help,  Can the project be connect with Microsoft sql server?.]]></description>
		<lastBuildDate>Sat, 02 Mar 2024 20:31:03 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: please help,  Can the project be connect with Microsoft sql server?]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=50399#p50399</link>
			<description><![CDATA[<p>Alright, I got it covered... this works to insert data from MVD to SQL Server:</p><div class="codebox"><pre><code>procedure PROCEDURE_NAME_Button1_OnClick (Sender: string; var Cancel: boolean);
 var
  Conn : Variant;
  db_settings,Col1,Col2 : String;
begin

  // ***  create database objects ****
   Conn :=createoleobject(&#039;ADODB.Connection&#039;) ;


   //*** set database connection parameters ***
  db_settings:=&#039;Provider=SQLOLEDB;Server=********;Database=********;UID=********;PWD=*******************;

  //*** Open connection to database ***
  Conn.Open(db_settings);

  //*** Insert data into SQLServer Database ***
  // Format of VALUES() ==&gt; if source field contains only numbers: ‘+&lt;name_of_field.txt&gt;+’   if source fields contains varchar ==&gt; ‘’’+&lt;name_of_field.txt&gt;+’’’   (triple single quotes)
  // One Conn.Execute() per insert.


Conn.Execute(&#039;INSERT INTO [TABLE_NAME] (Col1,Col2) VALUES (&#039;+FORM_NAME. FIELD_NAME1.Text+&#039;,&#039;&#039;&#039;+FORM_NAME. FIELD_NAME_2.Text+&#039;&#039;&#039;)&#039;);  //example using fields as datasource
//Conn.Execute(&#039;INSERT INTO [TABLE_NAME] (Col1,Col2) VALUES (111,’’VARCHAR_TEXT’’)’); //example using direct data (double single quotes only for varchar text)
     //Always close connection after each transaction
     Conn.Close;
end;</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (tcoton)]]></author>
			<pubDate>Sat, 02 Mar 2024 20:31:03 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=50399#p50399</guid>
		</item>
		<item>
			<title><![CDATA[Re: please help,  Can the project be connect with Microsoft sql server?]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=50391#p50391</link>
			<description><![CDATA[<p>I see a lot of examples to read data from MSSQL SERVER but none on INSERTS, did anyone ever tried to insert data from MVD to MSSQL SERVER?</p>]]></description>
			<author><![CDATA[null@example.com (tcoton)]]></author>
			<pubDate>Fri, 01 Mar 2024 23:15:50 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=50391#p50391</guid>
		</item>
		<item>
			<title><![CDATA[Re: please help,  Can the project be connect with Microsoft sql server?]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=46310#p46310</link>
			<description><![CDATA[<p>to secure your software...<br />delete script.pas and Pack Scripts folder ,Graphics.dll with software.exe using enigma virtual box.</p>]]></description>
			<author><![CDATA[null@example.com (StateOne)]]></author>
			<pubDate>Fri, 07 Oct 2022 13:37:24 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=46310#p46310</guid>
		</item>
		<item>
			<title><![CDATA[Re: please help,  Can the project be connect with Microsoft sql server?]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=46301#p46301</link>
			<description><![CDATA[<div class="quotebox"><cite>CDB wrote:</cite><blockquote><p>Thinking about how to make the connection secure, by which I take you mean the connection string is obfuscated in some way, I came up with the following idea. Not tested, so have no idea if it would work, and is probably more complicated than needs be! <img src="https://myvisualdatabase.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>1. Create a SQLite database that has just one table and for security about 5 fields.<br />..... Field 1 contains an encrypted form of the connection path details.<br />..... Field 2 ........&nbsp; &nbsp;contains the encryption key spread across one or more fields, the other fields&nbsp; contain dummy information and or the password<br />.</p><p>2. Before opening the SQL Server connection as demonstrated above, read in the SQLite database contents and perform the deincryption.</p><p>3. Parse the results into the actual&nbsp; db_settings:=&#039;Provider=SQLOLEDB;Server=localhost;database=DatabaseName;UID=UserName;PWD=password&#039;; <br />&nbsp; <br />To make it more secure, a function could be written that actually changes the encryption key (some sort of randomise function) each time the program is run, This could be placed on the MainForms OnClose event where the new encrypted path and key can be written back to the database. I assume the SQL Server DB would be disconnected at this point as well.</p><p>I&#039;ve probably over thought this far more than is necessary, but if it worked, this idea could also be used for other settings in the ini file such as column widths in tablegrids etc.</p><p>The other option would be to have the encryption or password key in plain sight, but looking like an encrypted&nbsp; string.</p></blockquote></div><p>Only to prevent that your software will be unsafe and funny for security features. Not as &quot;support&quot;.</p><p>Will not realy work<br />- .dcu file is a scripted code. Easy to reverse. even a full compiled .exe can be reveresd by some freeware reverser.<br />- encryption with RC5 has some issues with sqlite text storing. The character table is not constant utf, so it can happen that you can not decrypt what you have encrypted.<br />- it is allways a bad idea to store connection passwords in a sourcecode, ini file or database without a propper encryption and other safety elements.</p><p>Except script kiddis and beginner in programming others will break the security before breakfast just as a morning exercise.</p><p>Before you ask: MVD is abandon by the last statement of Dmitry. There are solutions possible, but I support only active compiler. Search for me in other forums and you will see how to make it. (have fun searching).</p>]]></description>
			<author><![CDATA[null@example.com (teco049)]]></author>
			<pubDate>Thu, 06 Oct 2022 14:36:12 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=46301#p46301</guid>
		</item>
		<item>
			<title><![CDATA[Re: please help,  Can the project be connect with Microsoft sql server?]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=46299#p46299</link>
			<description><![CDATA[<p>Thinking about how to make the connection secure, by which I take you mean the connection string is obfuscated in some way, I came up with the following idea. Not tested, so have no idea if it would work, and is probably more complicated than needs be! <img src="https://myvisualdatabase.com/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /></p><p>1. Create a SQLite database that has just one table and for security about 5 fields.<br />..... Field 1 contains an encrypted form of the connection path details.<br />..... Field 2 ........&nbsp; &nbsp;contains the encryption key spread across one or more fields, the other fields&nbsp; contain dummy information and or the password<br />.</p><p>2. Before opening the SQL Server connection as demonstrated above, read in the SQLite database contents and perform the deincryption.</p><p>3. Parse the results into the actual&nbsp; db_settings:=&#039;Provider=SQLOLEDB;Server=localhost;database=DatabaseName;UID=UserName;PWD=password&#039;; <br />&nbsp; <br />To make it more secure, a function could be written that actually changes the encryption key (some sort of randomise function) each time the program is run, This could be placed on the MainForms OnClose event where the new encrypted path and key can be written back to the database. I assume the SQL Server DB would be disconnected at this point as well.</p><p>I&#039;ve probably over thought this far more than is necessary, but if it worked, this idea could also be used for other settings in the ini file such as column widths in tablegrids etc.</p><p>The other option would be to have the encryption or password key in plain sight, but looking like an encrypted&nbsp; string.</p>]]></description>
			<author><![CDATA[null@example.com (CDB)]]></author>
			<pubDate>Thu, 06 Oct 2022 08:16:29 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=46299#p46299</guid>
		</item>
		<item>
			<title><![CDATA[Re: please help,  Can the project be connect with Microsoft sql server?]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=46298#p46298</link>
			<description><![CDATA[<div class="quotebox"><cite>tcoton wrote:</cite><blockquote><p>Is there a more secure way to connect to a SQL Server, everything is readable in the script file. Could it be possible to connect using ODBC connection directly so it is not hard coded?</p></blockquote></div><p>Here&#039;s my way of adding security to it. I think direct ODBC connection is not possible in Pascal Script.</p>]]></description>
			<author><![CDATA[null@example.com (brian.zaballa)]]></author>
			<pubDate>Wed, 05 Oct 2022 23:00:00 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=46298#p46298</guid>
		</item>
		<item>
			<title><![CDATA[Re: please help,  Can the project be connect with Microsoft sql server?]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=46297#p46297</link>
			<description><![CDATA[<p>Is there a more secure way to connect to a SQL Server, everything is readable in the script file. Could it be possible to connect using ODBC connection directly so it is not hard coded?</p>]]></description>
			<author><![CDATA[null@example.com (tcoton)]]></author>
			<pubDate>Wed, 05 Oct 2022 15:56:37 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=46297#p46297</guid>
		</item>
		<item>
			<title><![CDATA[Re: please help,  Can the project be connect with Microsoft sql server?]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=38803#p38803</link>
			<description><![CDATA[<p>another option </p><div class="quotebox"><blockquote><p>var<br />&nbsp; &nbsp; Conn, rs: Variant;<br />&nbsp; &nbsp; NxTextColumn: TNxTextColumn;<br /> //---------------------------------------------</p><br /><br /><br /><br /><p>procedure Form1_Button1_OnClick (Sender: TObject; var Cancel: boolean);<br />var<br />&nbsp; &nbsp; i: Integer;<br />begin<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; rs.Open&nbsp; (&#039; Select name,fathername,mobileno&#039;, Conn);</p><p>&nbsp; &nbsp;<br />&nbsp; </p><br /><p>&nbsp; &nbsp; try Form1.TableGrid1.Columns.Clear; except end;<br />&nbsp; &nbsp; try Form1.TableGrid1.Columns.Add(TNxTextColumn); except end;<br />&nbsp; &nbsp; try Form1.TableGrid1.Columns.Add(TNxTextColumn); except end;<br />&nbsp; &nbsp; try Form1.TableGrid1.Columns.Add(TNxTextColumn); except end;<br />&nbsp; <br />&nbsp; &nbsp; Form1.TableGrid1.Columns[0].Header.Caption := &#039;name&#039;;<br />&nbsp; &nbsp; Form1.TableGrid1.Columns[1].Header.Caption := &#039;fathername&#039;;<br />&nbsp; &nbsp; Form1.TableGrid1.Columns[2].Header.Caption := &#039;mobileno&#039;;</p><p>&nbsp; &nbsp; Form1.TableGrid1.Columns[0].Color := ClWhite;<br />&nbsp; &nbsp; Form1.TableGrid1.Columns[1].Color := ClWhite;<br />&nbsp; &nbsp; Form1.TableGrid1.Columns[2].Color := ClWhite;</p><p>&nbsp; &nbsp; Form1.TableGrid1.Font.Color := ClBlack;<br />&nbsp; &nbsp; Form1.TableGrid1.SelectedRow := -1;<br />&nbsp; &nbsp; i := 0;<br />&nbsp; &nbsp; while not rs.Eof do begin<br />&nbsp; &nbsp; &nbsp; &nbsp; Form1.TableGrid1.AddRow(1);<br />&nbsp; &nbsp; &nbsp; &nbsp; Form1.TableGrid1.Cells[0,i]:= rs.Fields[&#039;name&#039;];<br />&nbsp; &nbsp; &nbsp; &nbsp; Form1.TableGrid1.Cells[1,i]:= trim(rs.Fields[&#039;fathername&#039;]);<br />&nbsp; &nbsp; &nbsp; &nbsp; Form1.TableGrid1.Cells[2,i]:= trim(rs.Fields[&#039;mobileno&#039;]);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; Inc(i); // i := i+1<br />&nbsp; &nbsp; &nbsp; &nbsp; rs.movenext<br />&nbsp; &nbsp; end;<br />&nbsp; &nbsp; rs.close;<br />end;</p><p>procedure Form1_OnClose (Sender: TObject; Action: string);<br />begin<br />&nbsp; &nbsp; Conn.close;<br />end;</p><br /><p>//-------------------Connection to database-----------------------------////</p><p>begin</p><p>&nbsp; &nbsp; &nbsp;Conn :=createoleobject(&#039;ADODB.Connection&#039;) ; //<br />&nbsp; &nbsp; &nbsp;rs := createoleobject(&#039;ADODB.recordset&#039;);<br />&nbsp; &nbsp; &nbsp;Conn.Open(&#039;Provider=SQLOLEDB;Server=localhost;database=yourdatabaename;UID=username;PWD=userpassword&#039;);<br />// you can access database using ipaddress .replace localhost with ipaddress<br />&nbsp; &nbsp; Form1.Button1.Click;<br />end.</p></blockquote></div>]]></description>
			<author><![CDATA[null@example.com (blackpearl8534)]]></author>
			<pubDate>Tue, 10 Nov 2020 08:30:44 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=38803#p38803</guid>
		</item>
		<item>
			<title><![CDATA[Re: please help,  Can the project be connect with Microsoft sql server?]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=38801#p38801</link>
			<description><![CDATA[<p>procedure frm_main_Button1_OnClick (Sender: TObject; var Cancel: boolean);<br />var<br />&nbsp; Conn, rs : Variant;<br />&nbsp; db_settings, a,b,c: String;</p><p>&nbsp; i,j: int;<br />var NxTextColumn: TNxTextColumn;<br />begin<br />&nbsp; &nbsp;{***&nbsp; create database objects ****&nbsp; }<br />&nbsp; &nbsp;Conn :=createoleobject(&#039;ADODB.Connection&#039;) ; //<br />&nbsp; &nbsp;rs := createoleobject(&#039;ADODB.recordset&#039;);</p><p>&nbsp; &nbsp;{** open database connection ***&nbsp; }<br />&nbsp; db_settings:=&#039;Provider=SQLOLEDB;Server=localhost;database=DatabaseName;UID=UserName;PWD=password&#039;;&nbsp; &nbsp; //connection to database<br />&nbsp; &nbsp;Conn.Open(db_settings);&nbsp; &nbsp; //connection to database</p><p>&nbsp; &nbsp;{ query to get data}<br />&nbsp; &nbsp;rs.Open&nbsp; (&#039;Select name,dob,address from tablename&#039;, Conn); // sql query</p><p>&nbsp; &nbsp; //create table information<br />&nbsp; &nbsp; try frm_main.TableGrid1.Columns.Clear; except end;<br />&nbsp; &nbsp; try frm_main.TableGrid1.Columns.Add(TNxTextColumn); except end;<br />&nbsp; &nbsp; try frm_main.TableGrid1.Columns.Add(TNxTextColumn); except end;<br />&nbsp; &nbsp; try frm_main.TableGrid1.Columns.Add(TNxTextColumn); except end;</p><br /><br /><br /><p>&nbsp; &nbsp; //header name<br />&nbsp; &nbsp; frm_main.TableGrid1.Columns[0].Header.Caption := &#039;Name&#039;;<br />&nbsp; &nbsp; frm_main.TableGrid1.Columns[1].Header.Caption := &#039;DateofBirth&#039;;<br />&nbsp; &nbsp; frm_main.TableGrid1.Columns[2].Header.Caption := &#039;Address&#039;;</p><br /><br /><p>&nbsp; &nbsp;//initialized i<br />&nbsp; &nbsp;i:=0;</p><p>&nbsp; &nbsp;//while loop to get data from db<br />&nbsp; &nbsp;while not rs.Eof do<br />&nbsp; &nbsp; begin</p><p>&nbsp; &nbsp; &nbsp; &nbsp; Application.ProcessMessages;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;//retrieve data and stored them in variables<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;a:= trim(rs.Fields[&#039;Name&#039;]);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;b:= trim(rs.Fields[&#039;dob&#039;]);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;c:=trim(rs.Fields[&#039;Address&#039;]);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; //generate the data in Table Grid<br />&nbsp; &nbsp; &nbsp; &nbsp; frm_main.TableGrid1.AddRow(1);<br />&nbsp; &nbsp; &nbsp; &nbsp; frm_main.TableGrid1.Cells[0,i]:=a;<br />&nbsp; &nbsp; &nbsp; &nbsp; frm_main.TableGrid1.Cells[1,i]:= b;<br />&nbsp; &nbsp; &nbsp; &nbsp; frm_main.TableGrid1.Cells[2,i]:=c;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; i:=i+1; //increment i<br />&nbsp; &nbsp; &nbsp; &nbsp; rs.movenext ;&nbsp; &nbsp;//next record<br />&nbsp; &nbsp; end;<br />&nbsp; <br />&nbsp; &nbsp; &nbsp;//close connection<br />&nbsp; &nbsp; &nbsp;rs.Close;<br />&nbsp; &nbsp; &nbsp;Conn.Close;</p><p>end;</p>]]></description>
			<author><![CDATA[null@example.com (blackpearl8534)]]></author>
			<pubDate>Mon, 09 Nov 2020 16:46:56 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=38801#p38801</guid>
		</item>
		<item>
			<title><![CDATA[please help,  Can the project be connect with Microsoft sql server?]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=38796#p38796</link>
			<description><![CDATA[<p>Can the project be connect with Microsoft sql server?</p>]]></description>
			<author><![CDATA[null@example.com (abu7akm)]]></author>
			<pubDate>Mon, 09 Nov 2020 07:14:00 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=38796#p38796</guid>
		</item>
	</channel>
</rss>
