vb.net - Connection to SQL Database -
I am making connections to the SQL database and in a connection I am changing my query several times, this is my basic structure
I have the following questions
1) Is this the correct method of sending different queries in the SQL database?
2) Will this cause any memory leak or error.
Dim conn set conn = CreateObject ("ADODB.Connection") with conn. Provider = "Microsoft.Jet.OLEDB.4.0". ConnectionString = "Data Source = C: \ MAP_sample.xls," & Amp; "Extended Properties = Excel 8.0;" With OpenOpen & RS = Object ("ADODB. Resizeate") Question = "Select" from [Sheet1 $] where STATEM = 'ABC' 'RS Open Quarry, Con R.Coose
P> Change Question query = "SELECT * FROM [Sheet1 $] where id = '321' 'R.S. Open query, conn rs.close
query
query = "SELECT * FROM [Sheet1 $] where NAME = 'SMITH' '' Open query, conn rs.close set rs = nothing conn.close set conn looks like classic ASP with Visual Basic
This is one of the possible forms to send questions, Try again to recap in different categories or functions No, it will not be a reason for the memory leak or errors you are calling You can call the Open System later to restore the same, or any other, connection to the data source.
The only problem with this approach is when you need to open 2 record sets at the same time
If you talk about general code readability It is better to use the meaningful variable name
Comments
Post a Comment