I am building a solution in VB 2005 which uses SQL strings to determin varoius totals etc. It works fine on my machine - but when I deploy the solution and install it on another machine, it fails to show the totals at all. I am in no way an expert so i assume that I have overlooked something simple. I would be most grateful if anyone could point me in the right direction.

SQL strings and distributed applications
TonyPat
I don't get any error message, when you say what kind kind of a statement do you execute - could you give me clue as to what you mean
Chris
MichaelGaertner
kachh
Val - I have sorted my problem -which in turn has led to another. The reason that the results I wanted from my SQL query didn't work is because the database that I originally used was not on the receipients machine, so the path was therefore meaningless.
When asked if I want to save a copy of the database in the solution folder should I have said NO. Or should I change the path on the SQL query (on my original project) to reflect where the setup puts the database when it is distributed However this seems very strange to me. Hope this makes some sense. Any help would be appreciated.
Manitra
vurdlak
rseeders
Private
Sub saleenter() Dim strConnectionString As String = _ "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=C:\angelbackoffice\angelbackend.mdb" Dim objConnection As New OleDbConnection(strConnectionString) Dim strSQL As String = _ "SELECT sum(amount) as totalsalesthisFY from sales where [date] >= #" & Me.startdate.Text & "# AND [date] < #" & Me.enddate.Text & "#" Dim objCommand As New OleDbCommand(strSQL, objConnection) Dim objDataAdapter As New OleDbDataAdapter(objCommand) Dim objDataTable As New Data.DataTable("sales") Dim objDataRow As DataRow Try 'Open the database connectionobjConnection.Open()
'Fill the DataTable objectobjDataAdapter.Fill(objDataTable)
'Load the list box on the form For Each objDataRow In objDataTable.RowsTextBox6.Text =
"£" & Format(objDataRow.Item("totalsalesthisFY"), "standard") Next Catch OleDbExceptionErr As OleDbException 'Write the exceptionDebug.WriteLine(
"Sorry not enough data") End Try 'Close the database connectionobjConnection.Close()
'Clean upobjDataRow =
NothingobjDataTable.Dispose()
objDataTable =
NothingobjDataAdapter.Dispose()
objDataAdapter =
NothingobjCommand.Dispose()
objCommand =
NothingobjConnection.Dispose()
objConnection =
NothingDmitry Spitsyn
koranke
Dear Val
Thank you for the time you have taken to help me, my problem is that I need the end user to be able to select dates so that they can view sales from different years i.e. go back a year and so on. How would a parameterized query help
I am sure you are right though because I get this message in the immediate window
" A first chance exeption of type 'system.Data.OleDb.OleDbexception' occured in System.Data.dll Syntax error in date in query experssion '[date]>= ## AND [date] <##'.
Which means nothing to me, although it doesn't prevent the sloution from running.
CraigAP
DineshSharma