|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Hello,
I'm working on an ASP page whereby i have to connection to database to display rate depending on the booking ref. The problem is that it doesn't display any records. I have records for the queried booking ref but it always displays "No matching records" Please help... any idea? Here are my codes: Code:
dim strSql
dim objConn, objRS
set objconn= Server.CreateObject("ADODB.Connection")
objConn.Open "Driver={SQL SERVER};Server=achoonkalp;Database=taxi;"
Set objRS = Server.CreateObject("ADODB.RecordSet")
strSql="SELECT [SRate] FROM [Booking] where [BookingRef]=' " & book & "'"
objRS.Open strSql, objConn, 3, 2, 1
If not objRS.eof and not objRS.bof Then
rate = objRS.Fields("SRate")
response.Write("rate="& rate)
else
response.write("No matching records")
End IF
Thanks aish |
|
#2
|
|||
|
|||
|
response.write your strSql, copy the sql string and try it out in sql server query analyzer, and verify you get the correct records from your query.
__________________
====== Doug G ====== "Hide, hide witch! The good folk come to burn thee. Their keen enjoyment hid behind their gothic mask of duty." -Mark Clifton |
|
#3
|
|||
|
|||
|
Quote:
Thanks. there was a space in my query which was preventing it to get that specific record. thank you. aish |
|
#4
|
|||
|
|||
|
I'm glad you got it sorted.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Database connection problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|