| | |
BD remains open after SELECT
Please support our MS Access and FileMaker Pro advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jun 2007
Posts: 28
Reputation:
Solved Threads: 0
I am using the following code to retrieve the last entered value from a table and insert it into a textbox called rf.
The code below works but the DB remains open until I restart my computer.
THanks ViRiPuFF
The code below works but the DB remains open until I restart my computer.
Sub Page_Load()
If Request.QueryString("VesselName") Is Nothing Then
VesselName.Text = "Blank Name" 'some default value
Else
VesselName.Text = Request.QueryString("VesselName")
End If
'construct the command object and open a connection to the Returns table
Dim dbconn, sql, dbcomm, dbread
dbconn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;data source=" & Server.MapPath("AnnexII.mdb"))
dbconn.Open()
sql = "SELECT Ref FROM Returns WHERE VesselName = '" & Trim(VesselName.Text) & "'"
dbcomm = New OleDbCommand(sql, dbconn)
dbread = dbcomm.ExecuteReader()
If dbread.Read Then
rf.Text = dbread(0)
dbread.Close()
dbconn.Close()
End If
End Sub
</script>THanks ViRiPuFF
![]() |
Similar Threads
- Word Association Game (Posting Games)
- PHP Drop Down Box - Help (PHP)
- Can't Open Control Panel, My Computer, My Documents etc in Vista (Viruses, Spyware and other Nasties)
- How to change the currect recordset in a Form (Visual Basic 4 / 5 / 6)
- Vb.net source code to access data from Access Database (Visual Basic 4 / 5 / 6)
- ALL GMail invites to be posted here please! (Geeks' Lounge)
- modify script (Perl)
- virus (desktophijackb) gone, desktop still remains? (Viruses, Spyware and other Nasties)
- Virus report: msdirectx.sys (Viruses, Spyware and other Nasties)
- Unwanted Search Toolbar on IE 6.0 (Viruses, Spyware and other Nasties)
Other Threads in the MS Access and FileMaker Pro Forum
- Previous Thread: inventory db
- Next Thread: Perform a calculation in a query
Views: 604 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for MS Access and FileMaker Pro





