Click here to Skip to main content
15,924,036 members
Home / Discussions / Database
   

Database

 
Questionhow to display daily sales between the date? [urgent] Pin
campbells18-Oct-06 18:58
campbells18-Oct-06 18:58 
AnswerRe: how to display daily sales between the date? [urgent] Pin
Edbert P19-Oct-06 15:25
Edbert P19-Oct-06 15:25 
GeneralRe: how to display daily sales between the date? [urgent] Pin
campbells19-Oct-06 15:49
campbells19-Oct-06 15:49 
GeneralRe: how to display daily sales between the date? [urgent] Pin
Edbert P19-Oct-06 16:02
Edbert P19-Oct-06 16:02 
GeneralRe: how to display daily sales between the date? [urgent] Pin
Edbert P19-Oct-06 16:04
Edbert P19-Oct-06 16:04 
GeneralRe: how to display daily sales between the date? [urgent] Pin
campbells19-Oct-06 16:37
campbells19-Oct-06 16:37 
Questionsqlconnection Pin
avahia18-Oct-06 17:53
avahia18-Oct-06 17:53 
QuestionError I keep getting in my vb program (ADO error) Pin
MichaelDurham18-Oct-06 10:21
MichaelDurham18-Oct-06 10:21 
This is the exact error I keep getting:

The Microsoft Jet database engine could not find the object 'MailingLabelsTemp'. Make sure the object exists and that you spell its name and the path name correctly. (The other tables for some reason get this error too, not just mailinglabelstemp)

The concept is at the beginning the program uses already existing tables in the db. These are temp tables. I tried deleting them and recreating them, but what kept happening is basically the same thing. When it tries to open the recordset the table doesn't exist.
So the program fills each of these temp tables (which have the same fields as in the datareports) and then ties the datareport to that datasource and voila. However, if I dont' clear the table every time I display the report again it includes all the data from the old report, in other words I must clear the table before I write to it. But for some reason, after I clear it this error keeps coming up.
But this error is preventing all of that from happening.
.. this is my code for doing that:

Public Function clearTable(ByVal tableName As String) As Boolean
On Error GoTo uhhuh
'myConnection.BeginTrans
'Debug.Print myConnection.state
myConnection.Execute "DELETE * FROM [" & tableName & "]" ' TRUNCATE TABLE [tableName]
'need to somehow delete the table's content here
'myConnection.CommitTrans
clearTable = True
Exit Function
uhhuh:
'Stop
myConnection.RollbackTrans
Err.Clear
End Function

These are all the places (3) where it comes up with the same error:

1)
Public Sub fillMailingTableFromRS()
clearTable cMailingTableName
myLabelsSet.Open "SELECT * FROM " & cMailingTableName, myConnection, adOpenStatic, adLockOptimistic, adCmdText

2)
Public Function clearTable(ByVal tableName As String) As Boolean
On Error GoTo uhhuh
'myConnection.BeginTrans
'Debug.Print myConnection.state
myConnection.Execute "DELETE * FROM [" & tableName & "]" ' TRUNCATE TABLE [tableName]

3)
myHomeSalesSet.Open "SELECT * FROM " & cHomeSalesTableName, myConnection, adOpenStatic, adLockOptimistic, adCmdText

Also these are other subs that may or may not make a difference..

Public Sub initMyDatabase()
initMyDBGlobals
'init the db
Dim strConnect As String, strQuery As String, cmd As String
strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;"
strConnect = strConnect & "Persist Security Info=False;"
strConnect = strConnect & ";Data Source=" & myDBPath
myConnection.ConnectionString = strConnect
myConnection.ConnectionTimeout = 10
myConnection.CursorLocation = adOpenStatic
myConnection.Open

Public Sub closeMyDatabase()
On Error GoTo closeMyDBErr
Set myRecordSet = Nothing
Set myLabelsSet = Nothing
Set myHomeSalesSet = Nothing
clearTempTables
'close recordset first, then connection.
If myConnection.state = adStateOpen Then
myConnection.Close
End If
Set myConnection = Nothing
Set mydbobj = Nothing
Exit Sub
closeMyDBErr:
Resume Next
End Sub

Private Sub clearTempTables()
clearTable cMailingTableName
clearTable cHomeSalesTableName
'levels: myRecordSet, myrsSelection, myRSCriterion
'do not delete main table!
clearTable c2ndTable
clearTable c3rdTable
End Sub
AnswerRe: Error I keep getting in my vb program (ADO error) Pin
Edbert P19-Oct-06 18:41
Edbert P19-Oct-06 18:41 
GeneralRe: Error I keep getting in my vb program (ADO error) Pin
MichaelDurham24-Oct-06 8:24
MichaelDurham24-Oct-06 8:24 
QuestionSlow performance in .NET? Pin
Xiangyang Liu 刘向阳18-Oct-06 4:10
Xiangyang Liu 刘向阳18-Oct-06 4:10 
AnswerRe: Slow performance in .NET? Pin
Ed.Poore19-Oct-06 13:36
Ed.Poore19-Oct-06 13:36 
GeneralRe: Slow performance in .NET? Pin
Xiangyang Liu 刘向阳20-Oct-06 17:26
Xiangyang Liu 刘向阳20-Oct-06 17:26 
GeneralRe: Slow performance in .NET? Pin
Ed.Poore21-Oct-06 8:04
Ed.Poore21-Oct-06 8:04 
QuestionHow to increase size of database in SQL Server 2000 Pin
prakash_21017-Oct-06 23:24
prakash_21017-Oct-06 23:24 
AnswerRe: How to increase size of database in SQL Server 2000 Pin
Mairaaj Khan18-Oct-06 0:12
professionalMairaaj Khan18-Oct-06 0:12 
GeneralRe: How to increase size of database in SQL Server 2000 Pin
Jerry Hammond18-Oct-06 10:09
Jerry Hammond18-Oct-06 10:09 
QuestionUsing dataset in a client-server application Pin
baxter_dev17-Oct-06 23:11
baxter_dev17-Oct-06 23:11 
AnswerRe: Using dataset in a client-server application Pin
Colin Angus Mackay17-Oct-06 23:17
Colin Angus Mackay17-Oct-06 23:17 
GeneralRe: Using dataset in a client-server application [modified] Pin
baxter_dev17-Oct-06 23:41
baxter_dev17-Oct-06 23:41 
GeneralRe: Using dataset in a client-server application Pin
Ed.Poore19-Oct-06 13:38
Ed.Poore19-Oct-06 13:38 
QuestionHow to make DataSet transparently remoted, or proxied, or called by ref? Pin
vgrigor117-Oct-06 22:37
vgrigor117-Oct-06 22:37 
QuestionSQL Server 2000 Notification Services and .NET 2.0 Pin
asasov17-Oct-06 21:02
asasov17-Oct-06 21:02 
QuestionSaving date time! Pin
Shahzad.Aslam17-Oct-06 19:28
Shahzad.Aslam17-Oct-06 19:28 
AnswerRe: Saving date time! Pin
baerten18-Oct-06 1:37
baerten18-Oct-06 1:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.