Problem two users writing to the same file at same time

I

id10t error

Hello,

I am making a scanner application. It is an asp.net program. I am
having a problem when the users are using two scanners at one and they
try to write to the TPS file at the same time. Here is my code. Is
there anything i am doing wrong. If two people scan at the same time
the scanners will freeze up.

TPSupdate.ConnectionString =
ConfigurationManager.AppSettings.Get("DSNEMPMST")
TPSupdate.ConnectionString =
ConfigurationManager.AppSettings.Get("EMPMSTconnection")
'Opens the connection to get data from TPS file
TPSupdate.Open()
'Declares an object of OdbcCommand Object to execute the
select statement
Dim insertCmd As New Data.Odbc.OdbcCommand()
'Sets the propertirs of the command object
insertCmd.Connection = TPSupdate
insertCmd.CommandTimeout = 1000
'This will setup the record to be inserted into the table
insertCmd.CommandText = "Insert into RFPRD
(Numberscan,storenum,programid,usernumber,datescanned,timescanned)
Values ('" & numberscan & "','" & storenumber & "','" & programid &
"'," & userid & "," & todaynumber & "," & currenttime & ")"
'This is the command that will insert the record into
RFPRD.tps
insertCmd.ExecuteNonQuery()
insertCmd.Dispose()
TPSupdate.Close()
TPSupdate.Dispose()
 
G

Guest

Hello,

I am making a scanner application. It is an asp.net program. I am
having a problem when the users are using two scanners at one and they
try to write to the TPS file at the same time. Here is my code. Is
there anything i am doing wrong. If two people scan at the same time
the scanners will freeze up.

            TPSupdate.ConnectionString =
ConfigurationManager.AppSettings.Get("DSNEMPMST")
            TPSupdate.ConnectionString =
ConfigurationManager.AppSettings.Get("EMPMSTconnection")
            'Opens the connection to get data from TPS file
            TPSupdate.Open()
            'Declares an object of OdbcCommand Object to execute the
select statement
            Dim insertCmd As New Data.Odbc.OdbcCommand()
            'Sets the propertirs of the command object
            insertCmd.Connection = TPSupdate
            insertCmd.CommandTimeout = 1000
            'This will setup the record to be inserted into the table
            insertCmd.CommandText = "Insert into RFPRD
(Numberscan,storenum,programid,usernumber,datescanned,timescanned)
Values ('" & numberscan & "','" & storenumber & "','" & programid &
"'," & userid & "," & todaynumber & "," & currenttime & ")"
            'This is the command that will insert the record into
RFPRD.tps
            insertCmd.ExecuteNonQuery()
            insertCmd.Dispose()
            TPSupdate.Close()
            TPSupdate.Dispose()

Post your connection strings here. Did you try to add Try..End Try to
catch the exception (if any)?
 
I

id10t error

Post your connection strings here. Did you try to add Try..End Try to
catch the exception (if any)?- Hide quoted text -

- Show quoted text -

Here are my connection string
<add key="DSNEMPMST" value="DSN=Encryption" />
<add key="EmpmstConnection" value="DRIVER=SoftVelocity Topspeed
driver (*.tps);DBQ=C:\Documents and Settings\Desktop\RF Project\" />.
Yes I do have a try its just above the code i copied. It did not do
anything for me. The sanners just freeze up and nothing happens.
 
G

Guest

Here are my connection string
<add key="DSNEMPMST" value="DSN=Encryption" />
  <add key="EmpmstConnection" value="DRIVER=SoftVelocity Topspeed
driver (*.tps);DBQ=C:\Documents and Settings\Desktop\RF Project\" />.
Yes I do have a try its just above the code i copied. It did not do
anything for me. The sanners just freeze up and nothing happens.- Hide quoted text -

- Show quoted text -

I tried to google for concurrent connections in Clarion and found that
they use "2 separate database profiles (to ensure concurrent
connection sessions)"
http://www.sqlexec.com/DBMAN/DBManHelp.pdf (page 48)

Will it work? I don't know. Try it and if it does not work go to
www.softvelocity.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top