if single qoutes are '' then now the value = 0 and i still get the error
the full code i am using is :
Code:
Private Sub cmdSearch_Click()
Dim strSQL As String
'build the SQL statement based on what the user typed in txtSearch
strSQL = "SELECT * FROM tblActivation"
If txtSearch.Text <> "" Then
strSQL = strSQL & " WHERE Serial = " & Val(txtSearch.Text)
End If
'close the recordset (required before reloading it)
rs.Close
'load the new data
rs.Open strSQL, cn, adOpenKeyset, adLockPessimistic, adCmdText
'show the data
fillfields
End Sub
by the way i put '31031101059811167' in the textbox
If your question is answered then mark your thread RESOLVED and give credit to whoever answered it.
If you fail, try and try again, its the only way to success.
If the Serial field in the DB is text is doesnt mater if it is only holding numbers it is still text and the values must be surrounded by single qoutes like this:
Code:
Dim strSQL As String
'build the SQL statement based on what the user typed in txtSearch
strSQL = "SELECT * FROM tblActivation"
If txtSearch.Text <> "" Then
strSQL = strSQL & " WHERE Serial = '" & Trim(Replace(txtSearch.Text,"'","'')) & "'"
End If
if rs.State = adStateOpen Then rs.Close
'load the new data
rs.Open strSQL, cn, adOpenKeyset, adLockPessimistic, adCmdText
If Not rs.BOF and Not rs.EOF Then
'show the data
fillfields
Else
MsgBox "No Records Found that match the search crieteria."vbOKOnly + vbInformation,"No Data Found"
End If
ok im working with chris on this and i figured it out you use the ftp e.g.
"Data Source= ftp.ripway.com/act/activate.mdb"
but it also includes my desktop as part of the address how do i sort that out?
the error looks like this...
Thanks in advance
Danny
If at first you dont succeed, destroy all evidence that you tried in the first place.
I didn't tell it to use any part of my computer as you can see in the image (its the bit just above the error box) nor did i tell it to add a #, can anyone figure how to make it ignore my computer and only use the server please?
thanks in advance
If at first you dont succeed, destroy all evidence that you tried in the first place.
Access does not support being used on the web, tho there is a (unreliable) way to do that, as shown in our Database FAQs.
Note that this cannot use FTP, as that is File Transfer Protocol. Oh, and the reason for the desktop path being added there is that you did not specify a protocol (FTP), so the default (file) was assumed, and as it was not a full file path, it was appended to the 'current' directory.
i got it connecting now using a username and password but it cant open the file due to 'The workgroup information file is missing or opened exclusively by another user'
btw chris has uploaded the workgroup information file
If at first you dont succeed, destroy all evidence that you tried in the first place.
I'm afraid I have never used Access on the web (I have always used 'real' database systems like SQL Server instead), and have never seen that error before either.. I can only assume that it means that the specified table cannot be found in the database.
It looks more like the error is telling you that IIS can't connect properly to Access.
The most difficult part of developing a program is understanding the problem.
The second most difficult part is deciding how you're going to solve the problem.
Actually writing the program (translating your solution into some computer language) is the easiest part.
Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read. Please Help Us To Save Ana