Hej! <code> <code>databas
Har problem med att skicka in en variabel till min databas. Variabeln innehåller en sökväg men när jag ska skicka in den verkar innehållet i den "glömts" bort.
<code>
seeks = word(fileName)
</code>
anropar denna funktion som returnerar en sökväg:
<code>
Function word(afileName)
word= "C:\bild\" + afileName
End Function
</code>
Vill nu lägga in den sökvägen i min databas:
<code>
Dim test
test = seeks
If Request.QueryString("nyckelord")<>"" Then
dbconn.Open db ' öppna databasen
SQL="INSERT INTO image_tbl (word,frase,seek) "_
& "VALUES('" & Request.QueryString ("nyckelord") & "'" _
& ",'" & Request.QueryString("fras")&"'"_
& ",'" & Response.Write(test)&"')"
dbconn.Execute (SQL)
End If
</code>
Vore snällt om nån ville ta sig en titt?!Sv: databas
SQL="INSERT INTO image_tbl (word,frase,seek) "_
& "VALUES('" & Request.QueryString ("nyckelord") & "'" _
& ",'" & Request.QueryString("fras")&"'"_
& ",'" & test & "')"
dbconn.Execute SQL
End If
</code>Sv: databas
seeks = word(fileName)
Function word(afileName)
word= "C:\bild\" + afileName
End Function
Function SQLText(Value)
If Len(Value) > 0 Then
SQLText = "'" & Replace(Value,"'","''") & "'"
Else
SQLText = "Null"
End If
End Function
Dim test
test = seeks
If Len(Request.QueryString("nyckelord")>0 Then
dbconn.Open db ' öppna databasen
SQL = "INSERT INTO image_tbl (word, frase, seek) " & _
"VALUES(" & SQLText(Request.QueryString("nyckelord")) & "," & _
SQLText(Request.QueryString("fras") & "," & SQLText(test) &")"
dbconn.Execute (SQL)
End If
</code>