|
Try setting the OleDbType of Punch to OleDbType.DBTimeStamp.
That will pass the date and time parts.
However, you should get into the habit of creating an ID column for each of your tables. This should be the Primary Key of the table. This ID will uniquely identify each row in your tables. Then, all you have to do is pass the ID number in the WHERE clause of your UPDATE and DELETE queries.
This is not only easier to read and control, but is more efficient since primary keys are always indexed. The index will be used by your DB engine to locate records much quicker and so will perform your commands with the highest efficiency.
I don't know if any of the other columns could be used as a primary key?
If so, since it is unique, all you have to do is pass that value so the DB knows which row to work on. The data in the other fields is irrelevant since all you need to do is identify the row to delete.
Steve
|
|
|
|
|
That worked like a champ. As for best practices in creating databases, I am certain that there are many issues with the design of the databases that I deal with, but I am not the developer and must therefore work with what I am given.
Thanks for your help. I was nervous about posting questions on here, but it was a great experience. Thanks again.
|
|
|
|
|
You are welcome! I'm pleased to help.
Most of the people that provide answers on forums like this, do so because they like to help people. You shouldn't be nervous. We all started somewhere and I often have need to ask questions myself!
Hope you voted for me! (Rate my answer)
Steve
|
|
|
|
|
Hi,
U can try the following 'CAST'
------------------------------
SELECT Clock_Nbr, CAST(Punch AS VARCHAR(20)), Seq_No FROM TIME_POST_WORK ORDER BY Punch
With Regards,
Pandian S
|
|
|
|
|
We have an application that stores a list of recipients from our Exchange server (5.5) in an SQLServer database. We use LDAP to get the list. No problem.
We are migrating to a new Exchange server (6.5) and I have not been able to determine how to get the recipients list.
Any help would be appreciated.
Tim
|
|
|
|
|
I need concept and contents of HR Software. I also need code of HR software.
|
|
|
|
|
What do you mean by HR?
High Resolution? Human Resources?
|
|
|
|
|
I can shell to wordpad, no problem.
I can open up a .rtf file from a subdirectory such as "C:\temp\filename.rtf"
I CAN'T open up a .rtf file from a subdirectory such as "C:\Documents and Settings\filename.rtf". I.E.: A subdirectory with a space in it. My line of code is:
--------------------------------------------------------
Shell("C:\Program Files\Windows NT\Accessories\wordpad.exe C:\Documents and Settings\wordpadtest.rtf", AppWinStyle.MaximizedFocus)
--------------------------------------------------------
When I try that I get the error:
"C:\Documents
Cannot find this file. Please verify that the correct path and file name are given."
I can do something similar in Notepad opening up a .txt file with no problems.
Is this a bug?
-- modified at 9:39 Wednesday 16th August, 2006
|
|
|
|
|
Try this:
Shell("""C:\Program Files\Windows NT\Accessories\wordpad.exe"" C:\Documents and Settings\wordpadtest.rtf", AppWinStyle.MaximizedFocus)
Steve
|
|
|
|
|
Steve,
Thanks for the suggestion but same reply:
"c:\Documents
Cannot find this file.
Please verify that the correct path and file name are given.
Will tweak what you suggested though...see if something else comes of it.
Thanks again!
|
|
|
|
|
You may want to try:
Shell("C:\Documents and Settings\wordpadtest.rtf", AppWinStyle.MaximizedFocus)
The application set to open .rtf files as a default should execute.
Steve
|
|
|
|
|
Put quotes around the filename:
Shell("C:\Program Files\Windows NT\Accessories\wordpad.exe ""C:\Documents and Settings\wordpadtest.rtf""", AppWinStyle.MaximizedFocus)
---
b { font-weight: normal; }
|
|
|
|
|
Actually got it running by doing the following:
Shell(Chr(34) & "C:\Program Files\Windows NT\Accessories\wordpad.exe" & Chr(34) & " " & Chr(34) & "C:\Documents and Settings\wordpadtest.rtf", AppWinSTyle.MaximizedFocus)
Thanks to all that replied to get this line of code punched out.
|
|
|
|
|
Which gives the same result as:
Shell("""C:\Program Files\Windows NT\Accessories\wordpad.exe"" ""C:\Documents and Settings\wordpadtest.rtf", AppWinSTyle.MaximizedFocus)
However, you should use matching start and end quotes:
Shell("""C:\Program Files\Windows NT\Accessories\wordpad.exe"" ""C:\Documents and Settings\wordpadtest.rtf""", AppWinSTyle.MaximizedFocus)
---
b { font-weight: normal; }
|
|
|
|
|
Hi there, i need some help on how to customize the setup project for example, like changing to font and the style to xp styles and also need to change the form colors to white, i know it can be done coz i have seen it before, its just wen i open the user interface dialog and click on the forms for example welcome there is only three properties to set like a banner and the text and the copyright warning can anyone help me please this is really important and i need help as soon as possible ... Thanks
MaryAndNaz
|
|
|
|
|
When i try to run an exe it gives error saying \\abc\d\e.mdb is not a valid path
So i made a folder where the exe was called abc in it sub folder d and in it pasted e.mdb still it gave me same error
Also when i tried to open the code it gave error that crviewer9.dll was missing
so i downloaded and registered the dll
but then when i click on any file in project with .dsr extention it can't open it
also when i try to compile the code it gives Unexpected Error 50003
I am using VB 6 and Crystal Reports 8.0
Don't know with what version of reports was the present code written
I tried ver 10 but got error saying not able to load files with dsr extention
Atleast with ver 8.0 it opens without any problem but am not able to complie
Thanks
-- modified at 8:59 Wednesday 16th August, 2006
|
|
|
|
|
Hi Everyone,
How to check the OS during installation, Dll varies and Registration depending upon OS. Can any one help me in this regard.
Regards,
Manowj
|
|
|
|
|
Hi All
I am using MS SQL Serve 2000 as back end data storage. One of the column in one particular table is of type TEXT. Here the problem is I am not able to view the entire content of the column by any mean. I am storing a large amount of data in that particular column. Select query returns initial small portion of the stored data. Even if I open the table through Enterprise manager also I am not able to see. Moreover while saving if I trace it through profiler there also I will be able to view very small portion of original data. So can anybody sagest me, how can I view the data?
Thanks in advance,
Regards,
Krishnaraj
|
|
|
|
|
The Enterprise Manager and the Visual Studio debugger does not show the entire value, but your code have access to all the data. If you need to see the full value, output it from your program.
---
b { font-weight: normal; }
|
|
|
|
|
I have a app with a form that has a lot of controls on it.
when showing the form there can be a delay of several seconds which is too much.
I've narrowed down most of this time to the form's InitializeComponent.
i Could really use some helpful hints about how to improve performance.
|
|
|
|
|
Your best option is to lower the number of controls on the form. Controls are heavy-weight objects and creating large numbers of controls takes time. There's very little you can do to speed it up.
In the past, the only GOOD suggestion in cases like this is to rethink your interface. For example, do you REALLY need 50 buttons and 100 textboxes on a form? More than likely not. Break up your interface into multiple forms as logical containers encapsulating related chunks of your data.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thanks for the reply.
The form unfortunately includes a Tab control with 7 tab pages on it, each of which has a bunch of controls. I could problably reuse most of the controls on the diffrent tabs, at the expense of lowering the readabillity of my code.
I dont have many options tho, the customer wants exactly the same app, just in .NET.
NB. Dont know if this info is important but, the code was ported from VB6 to VB.net and corrections have been made to make it work.
-- modified at 8:57 Wednesday 16th August, 2006
|
|
|
|
|
Michael Andersson wrote: Tab control with 7 tab pages on it, each of which has a bunch of controls.
Option - you could create the controls on the tab page dynamically when the page is first called. It'll mean more coding but would probably shave some time off.
Another idea would be to create a "Please Wait..." form which is a simple matter of creating a form with a progress bar control and a timer. It's just a simple way of keeping your user informed that your app is actually doing something.
|
|
|
|
|
I have a value in my access databse which is tick and untick , i think the value is YES/NO. In VB i try to set the value but i having this error....
anyone know wat it mean?
Error:
Run-time error '91':
object variable or with block variable not set
Highlight error:
DB.Execute "UPDATE Dono SET InvoicePrint = " & yes & _
" WHERE [NO] = " & "'" & Dorder.dono.Text & "'"
original code:
Dim message, dialog, title, answer
message = "Print Invoice?"
dialogtype = vbYesNo + vbQuestion
title = "Print invoice?"
answer = MsgBox(message, dialogtype, title)
If answer = vbYes Then
DB.Execute "UPDATE Dono SET InvoicePrint = " & yes & _
" WHERE [NO] = " & "'" & Dorder.dono.Text & "'"
MsgBox ("record updated successfully...")
End If
|
|
|
|
|
Hi campbells,
Please check and confirm that you have declared db as a new connection, and when you pass a string into a database , use '[single Quotes] before and after a string ok. This might solve your problem, Again if you find problem, reply me
Regards,
Manowj
Regards,
Manowj
|
|
|
|