|
Yes, it applies to Form class too. As far as the Runtime is concerned, Form is just a Type, it gets no special treatment from the Runtime.
|
|
|
|
|
I have made this database which use ms-access and the data are enter through vb6. On the form the date entered were display as they are entered but on the access table is has changed for example 1 jan 2008, 25 jan, 2008 were display like 01-jan-08 and 25-jan-08 respectively which is okay, but 4 july 2008 happen to be 07-apr-08 and 12 oct 2008 becomes 10 dec 2008. Can any one tell me how some dates gets change in the .mdb file while some doesnot change, and even they are change in the ms-access database file when display them on the form they look still okay as enter.
Would be grateful is anyone throw light on this.
Thank you.
SZ
|
|
|
|
|
It is a long time since I used Access and VB6 but as I recall the dates in the mdb file are always in American format (mm-dd-yyyy). What I don't understand is how 28 Jan 08 remains untouched!
Possibly the problem is that 28 Jan 08 does not have an American equivalent so is forced to what happens to be the correct format. You should set something up to specifically format your dates as you want to see them rather than depend on the built in stuff.
|
|
|
|
|
Internally, the dates are not stored in any format. They are a serial number that represents a date/time.
The problem appears to be that whatever code is entering dates into the database is using methods that are no culture-tolerant nor consistant acrossed the code. The common mistake that causes this is using string concatentation to build SQL queries using dates:
' The BAD way...
Dim query As String
query = "INSERT INTO table VALUES (#" & somedatevariable & "#)"
You should be using parameterized queries instead. Use the OleDbParameter class to handle dates and times for you.
You can find a good example of this here[^].
|
|
|
|
|
Hi Dear,
Check your System's Date and Time Settings and make it DD-MM-YYYY, similarly at the time of save date into the access table use the format function like format(dtpicker1.value,"dd-mm-yyyy").
May this helps you...
|
|
|
|
|
Access interprets a date string in American format first. When that fails, it takes a look at the date settings of your computer, and tries again with those settings (or the other way round - I am not sure). Hence, on a non-American computer the outcome is sometimes correct, sometimes wrong.
Parameterized queries - as suggested above - are the solution.
|
|
|
|
|
I got em right now, i had not set right on the form properties, makes changes there and hope it would work fine now. Thank you guys for your time.
zela.
|
|
|
|
|
Hi all,
I need to plot a graph on a Windows forms using numeric values stored in an excel sheet
I came accross this code .. it creates an excel sheet and plot graphs in an excel sheet itself
Public Class testchart
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim objXL As Object
Dim objWbk As Object
Dim oSheet As Object ' Excel Worksheet
Dim oChart As Object ' Excel Chart
objXL = CreateObject("Excel.application")
objWbk = objXL.workbooks.Open("C:\testing\test.xls")
On Error GoTo ErrHandler
Dim iRow As Integer ' Index variable for the current Row
Dim iCol As Integer ' Index variable for the current Row
Const cNumCols = 10 ' Number of points in each Series
Const cNumRows = 2 ' Number of Series
oSheet = objWbk.Worksheets.Item(1)
oChart = oSheet.ChartObjects.Add(50, 40, 300, 200).Chart
oChart.SetSourceData(Source:=oSheet.Range("A1").Resize(cNumRows, cNumCols))
' Make Excel Visible:
objXL.Visible = True
objXL.UserControl = True
ExitHandler:
On Error Resume Next
objWbk = Nothing
objXL.Quit()
objXL = Nothing
Exit Sub
ErrHandler:
MsgBox(Err.Description, vbExclamation)
Resume ExitHandler
End Sub
End Class
Unable to figure out as to how the same graph can be plotted on a windows form using data from excel
Please guide,
Thanks,
Gauti.
|
|
|
|
|
It would be much easier to get the data from the Excel sheet and use something like this[^] to show the chart on your own form.
|
|
|
|
|
|
Tmoshea wrote: I have used Zedgraph for charting bar graphs as well as waveforms
Congratulations!
Why are you telling ME this?? I don't care. You might want to reply to the original poster next time. That way, THEY will get the message that someone replied to THEIR post.
|
|
|
|
|
I have used Zedgraph for charting bar graphs as well as waveforms. There is an example on this website:A flexible charting library for .NET
modified on Tuesday, July 12, 2011 11:57 AM
|
|
|
|
|
Thank you Tmoshea..
Can u plz help me with a small example of how to implement it using Zedgraph .. [plot a graph on windows form using values from a closed excel sheet] ..
Regards...
Gauti..
|
|
|
|
|
Hi,
I try to upgrade my VS2008 project into VS2010. Its get updated no problem. But when i check from my user system, Its giving the above error...Colunot load file or assembly....
Any Ideas [or] Guidences..
Thanks for Helps
|
|
|
|
|
That means the correct Crystal Reports runtime version isn't installed on your users machines.
|
|
|
|
|
|
I have to make an installer for a Windows service with a Visual Studio installation project. But the guy who made the service (not me), just gave me the compiled .dll and .exe that is required. Now, everywhere I see, I have to compile the webservice with an installer class specifying the name.
Is there another way to install windows services without this installer class? Like running the InstallUtil.exe from code with the location of the .exe as a parameter? (Tried that, doesn't work at the moment. No idea why.) Any other ideas?
|
|
|
|
|
|
Hmmm, I can use the sc command in code... I think.
Thanks!
EDIT: It worked. You can add and delete a windows service with:
Const ServiceName = "Name"
strPathService = My.Settings("path")
Shell(String.Format("sc create {0} binpath= ""{1}"" start= auto displayname= {0}", ServiceName, strPathService), AppWinStyle.NormalFocus, True)
modified on Monday, July 11, 2011 3:13 AM
|
|
|
|
|
KenBonny wrote: But the guy who made the service (not me), just gave me the compiled .dll and .exe that is required.
Did he use a code-obfuscator?
Bastard Programmer from Hell
|
|
|
|
|
Yes. (I had thought of decompiling the code and doing it myself, but all dll's that are shipped to clients, must be obfuscated.)
|
|
|
|
|
how to create a master page in vb.net
|
|
|
|
|
|
Hola lista tengo un problema y es que quiero guardar puntero al ultimo archivo leido por Dir.. me refiero a esto:
Tengo un bucle :
<br />
sArchivo = Dir(sFullPath2DirCliente)<br />
iCountPictureOnFirstLoad = 0<br />
<br />
Do While sArchivo <> vbNullString<br />
If nII < 12 Then<br />
If mbCargarImagen(sImageRootDir & sDirCliente & sArchivo, nII) Then<br />
imgSnapshot(nII).Tag = sImageRootDir & sDirCliente & sArchivo<br />
Me.LblFechaFoto(nII).Caption = FileSystem.FileDateTime(imgSnapshot(nII).Tag)<br />
iCountPictureOnFirstLoad = iCountPictureOnFirstLoad + 1 ' By Almeda<br />
Else<br />
imgSnapshot(nII).Tag = vbNullString<br />
Me.LblFechaFoto(nII).Caption = ""<br />
End If<br />
Else<br />
Exit Do<br />
End If<br />
sArchivo = Dir$<br />
nII = nII + 1<br />
Loop<br />
El problema es que dentro de la funcion mbCargarImagen existe una sentencia que crea archivos temporales, por lo tanto cuando se ejecuta el sArchivo = Dir$ ya se perdió el puntero al ultimo archivo leido y me sale el error Invalid procedure call or argument...
Alguien sabe como se soluciona esto????
GRACIAS!!!
|
|
|
|
|
I guess you did not notice that this is an English language forum. Please get your question translated and people will try to help you.
The best things in life are not things.
|
|
|
|