Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sockets into the database.

Status
Not open for further replies.

TheKing

Programmer
Feb 25, 2002
151
0
0
US
Hello all....

I wrote a program that uses about 400 different select statements with around 20 different Recordset names.

Set up this way
Client side processing
Code:
Public g_Database_Connection as String
G_Database_Connection = (here is the connection string out of the ini file.)

Now you set and define the Recordset
Code:
Set rstAdd_Info = New Recordset
With rstAdd_Info
            .CursorLocation = adUseClient
            .CursorType = adOpenKeyset
            .LockType = adLockOptimistic
            .ActiveConnection = g_Database_Connection
            .Open “[This would be the sql statement here]”
Now do what ever you need to do with the data
Code:
            .Close
        End With
That above code(with the only change being the Recordset’s name) happens 200 to 400 times in one process of a flat file(depending on the size of the file).

Here is the server side code.
Code:
   Set cn = New Connection
   cn.Open g_Database_Connection
Open the connectionstring
Code:
   cn.Execute "UPDATE " & Database_Owner & "Table_Name SET Field1 = Field1 || '" & Mid(Record, 255, Len_of_Record) & "' WHERE ID_Field = " & ID_I_am_on
   cn.Close
Set cn = Nothing
I was under the understanding that when set to Nothing an Active Connection is destroyed.

the server side code that I have twice in my program, both times it is set to nothing after it is used, and they are used at the beginning of the program and then not used again.



So my problem is that right now my program is running and it seems to be using between 36 and 45 diffent sockets for it's operation. That is way too many, I was hoping for just 3, one client side one and two server side ones.

Any thoughts on this one for me?

T[sup]h[/sup]e[sub]K[/sub]i[sup]n[/sup]g
[pc3]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top