How HMG works with SQL server express ?

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

huangchenmin
Posts: 157
Joined: Mon Jun 07, 2010 2:24 am

Re: How HMG works with SQL server express ?

Post by huangchenmin »

mol wrote:I've integrated MS SQL Express with HMG via ODBC. I Put my code, if you are interested........
[/code]
Dear mol:
There are some function, which I could find in CA-Clipper.
Otherwise, some of functions, which I don't ever use that.
Do you mind if I ask futher details about your routines ?
Best Regards
chen min
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: How HMG works with SQL server express ?

Post by mol »

I'll post rest of function in ZIP file, I have no time to translate it, but, it's clear written, I think.

This code is written using harbour and HMG. It's the best to use version 3.0.36.
There is some problems with national characters with later versions.


You can use all of this code, you can change it.
If you find problems, ask!

Best regards, Marek
Attachments
KOR_MSSQL_SDDODBC.ZIP
(32.11 KiB) Downloaded 463 times
huangchenmin
Posts: 157
Joined: Mon Jun 07, 2010 2:24 am

Re: How HMG works with SQL server express ?

Post by huangchenmin »

mol wrote:I'll post rest of function in ZIP file, I have no time to translate it, but, it's clear written, I think.
.............

You can use all of this code, you can change it.
If you find problems, ask!

Best regards, Marek
Deal mol:
Thank you very very much again.
I read plenty of SQL express to understand your code instead of bothering you a lot.
Thank you for providing the rest code of routines. I will try to figure it out on my own as possible as I can.
Best Regards
chen min
huangchenmin
Posts: 157
Joined: Mon Jun 07, 2010 2:24 am

Re: How HMG works with SQL server express ?

Post by huangchenmin »

mol wrote:I've integrated MS SQL Express with HMG via ODBC. I Put my code, if you are interested...

try with cSQLUser = sa and empty password = ""

Code: Select all


function 	SetDataBaseConnection
		cConStr := "Driver={SQL Server};Server=" + cSQLSerwer + ";Database="+ cSQLDataBase + ";Trusted_Connection=yes;Uid=" + cSQLUser + ";Pwd="+ cSQLPassword +";"
			RDDSETDEFAULT( "SQLMIX" )
			SET( 4, "yyyy-mm-dd" )
			WAIT WINDOW "Wait for connection..." NOWAIT
			nConnection := RDDINFO( 1001, { "ODBC", cConStr }, 'SQLMIX' )..........
Dear Mol:
Don't blame me for following stupid question!
Assume that SQL Express server 2005 is installed in a lantop with name "TOM-NB". SQL server with name "SQLEXPRESS"
1.Should variable 'server' be assigned 'TOM-NB\SQLEXPRESS' ?
2.What is the server name will be if I remotely connect to SQL server ?
3.Sould I request SDDODBC, SQLMIX whenever I would like to make a connection to SQL server?
4.Does RDDINFO() return values other than zero ? Is RDDINFO() a HMG function? where to get the information about it?
Best Regards
chen min
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: How HMG works with SQL server express ?

Post by mol »

First, server variable should be set as below:

server := "tom_nb\sql_express_instance"
- when you install sql express, you are asked for name of instance...
when yuu need to connect to remote computer, you can replace "tom_nb" with computer's name or computer's ip.

ad. 3
In my pattern i've used only sqlmix. sddodbc is not required and stayed here from tests I've been making some time ago.

ad. 4
Truely, I don't know RDDINFO function :lol:
I was searching good way to connect to mssql and I found somewhere working solution. So, I've moved it to my application...
And, it began to work :D

Best regards, Marek
Last edited by mol on Tue Mar 06, 2012 6:26 am, edited 1 time in total.
huangchenmin
Posts: 157
Joined: Mon Jun 07, 2010 2:24 am

Re: How HMG works with SQL server express ?

Post by huangchenmin »

mol wrote:First, server variable should be set as below:

server := "tom_nb\sql_express_instance"
- when you install sql express, you ares asked for name of instance...
when yuu need to connect to remote computer, you can replace "tom_nb" with computer's name or computer's ip.
......
Best regards, Marek
Dear Mol:
Truely thanks for replying to me.
It is reall a big big help to me.
Thank you Sincerely.
Besr Regards
chen min
User avatar
mol
Posts: 3718
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: How HMG works with SQL server express ?

Post by mol »

huangchenmin wrote: Dear Mol:
Truely thanks for replying to me.
It is reall a big big help to me.
Thank you Sincerely.
Besr Regards
chen min
This is only compilation of code found on few forums...

You pour honey on my heart :lol: :lol: :lol:

I'm glad it was useful for you!
Best regards!
huangchenmin
Posts: 157
Joined: Mon Jun 07, 2010 2:24 am

Re: How HMG works with SQL server express ?

Post by huangchenmin »

mol wrote:I've integrated MS SQL Express with HMG via ODBC. I Put my code, if you are interested...

try with cSQLUser = sa and empty password = ""

Code: Select all


function 	SetDataBaseConnection
	
		cConStr := "Driver={SQL Server};Server=" + cSQLSerwer + ";Database="+ cSQLDataBase + ";Trusted_Connection=yes;Uid=" + cSQLUser + ";Pwd="+ cSQLPassword +";"
			RDDSETDEFAULT( "SQLMIX" )
			SET( 4, "yyyy-mm-dd" )
			WAIT WINDOW "Wait for connection..." NOWAIT
			nConnection := RDDINFO( 1001, { "ODBC", cConStr }, 'SQLMIX' ).......
return
Dear mol:
I need your help to debug.
Attachment is my routine for connecting SQL server. Both ODBC and remote connection are allowed. And I connect to SQL Server Express 2005 successfully with SQLCMD, meanwhile create a database named 'testdb'.
SQLtest.prg fail to connect to SQL Server.
Please Help!
Best Regards
chen min
Attachments
SQLtest.rar
(1.67 KiB) Downloaded 297 times
huangchenmin
Posts: 157
Joined: Mon Jun 07, 2010 2:24 am

Re: How HMG works with SQL server express ?

Post by huangchenmin »

huangchenmin wrote:
mol wrote:I've integrated MS SQL Express with HMG via ODBC. I Put my code, if you are interested...

try with cSQLUser = sa and empty password = ""

Code: Select all


function 	SetDataBaseConnection
		cConStr := "Driver={SQL Server};Server=" + cSQLSerwer + ";Database="+ cSQLDataBase + ";Trusted_Connection=yes;Uid=" + cSQLUser + ";Pwd="+ cSQLPassword +";"
			RDDSETDEFAULT( "SQLMIX" )
			SET( 4, "yyyy-mm-dd" )
			WAIT WINDOW "Wait for connection..." NOWAIT
			nConnection := RDDINFO( 1001, { "ODBC", cConStr }, 'SQLMIX' )..........
Dear Mol:
Don't blame me for following stupid question!
Assume that SQL Express server 2005 is installed in a lantop with name "TOM-NB". SQL server with name "SQLEXPRESS"
1.Should variable 'server' be assigned 'TOM-NB\SQLEXPRESS' ?
2.What is the server name will be if I remotely connect to SQL server ?
3.Sould I request SDDODBC, SQLMIX whenever I would like to make a connection to SQL server?
4.Does RDDINFO() return values other than zero ? Is RDDINFO() a HMG function? where to get the information about it?
Best Regards
chen min
Dear mol:
I posted for asling help yesterday.
It is done. Failing to connect to SLQ Server Express 2005 caused by short request SDDODBC. It might because that I set up ODBC configuration on server. I try again with only SQLMIX someday after removing ODBC. by now I have to go through other data manipulating as soon as possible.
I want to thank you again for sharing and helping me on this issue again.
Best regards
chen min
Post Reply