Page 2 of 3

Re: How HMG works with SQL server express ?

Posted: Tue Feb 28, 2012 1:39 am
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

Re: How HMG works with SQL server express ?

Posted: Tue Feb 28, 2012 3:55 pm
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

Re: How HMG works with SQL server express ?

Posted: Thu Mar 01, 2012 1:30 pm
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

Re: How HMG works with SQL server express ?

Posted: Thu Mar 01, 2012 3:43 pm
by mol
Nice to be useful ;)
Nice work, Marek.

Re: How HMG works with SQL server express ?

Posted: Mon Mar 05, 2012 10:42 am
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

Re: How HMG works with SQL server express ?

Posted: Mon Mar 05, 2012 8:00 pm
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

Re: How HMG works with SQL server express ?

Posted: Tue Mar 06, 2012 1:02 am
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

Re: How HMG works with SQL server express ?

Posted: Tue Mar 06, 2012 6:29 am
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!

Re: How HMG works with SQL server express ?

Posted: Fri Mar 09, 2012 4:30 pm
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

Re: How HMG works with SQL server express ?

Posted: Sat Mar 10, 2012 8:17 am
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