Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Communication link failure vs. ConnectionWrite
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Title:
Communication link failure vs. ConnectionWrite
Miscellaneous
Thread ID:
01679837
Message ID:
01679837
Views:
57
Hi,

This is another thread on attempting to minimize VFP 9 application's issues with connecting to the SQL Server.

Last week I was dealing with the problem which created an error message:
[Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionWrite (send()).
I applied the code suggested by Walter Meester and so far, I have not received errors.

But this morning I received an error that looks a little different. The error is:
[ODBC SQL Server Driver]Communication link failure
The latter error happens when the application attempts to FILL the CA cursor with the records from the SQL Server.

Two questions:
1. Do you think both errors are caused by the same underlying issue that the application was idle and lost connection to the SQL Server?
2. If above is correct, do you suggest to check the connection (using the approach described by Walter) before every time the application tries to FILL the CA cursor? I am just concerned about slowing down the applicaiton.

TIA

UPDATE: Below is the code (almost exactly) from my app that gets the records from the SQL Server into the CA cursor:
       *-- oApp.conn_handle is the connection handle created at the top of the application
	this.ca_object.DataSource = oApp.conn_handle
       *-- tcSqlSelectExpression is the SQL Select expresion
	this.ca_object.SelectCmd = tcSqlSelectExpression

	IF !this.ca_object.CursorFill()  
		AERROR( aErrorInf )
		this.error_message_text = "SQL Select expression: " + CHR(13) + ;
			tcSqlSelectExpression + CHR(13) + ;
				"Error Message: " + aErrorInf[1,2]
			this.error_message_title = "Failed Execute Cursor Fill Method"
			this.error_number = aErrorInfo[1,1]				

		lReturn = .F.
	ENDIF 
Should I add the code to check the connection right before the call .CA_OBJECT.CursorFill() above?
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Next
Reply
Map
View

Click here to load this message in the networking platform