|
I have SQL that is returning 24 rows in SQLPlus however when I run the same query in VS2010 using Provider=OraOLEDB.Oracle its doesn't return any rows. I am using a LIKE operator with to_date. Any suggestions? Is it the provider I am using the problem?
See example
select level from testTable where dTime LIKE to_date('3/27/2013','MM/DD/YYYY') and station = '019654' order by dTime
I did try it with '%3/27/2013%'
|
|
|
|
|
Have you tried running the query in Oracle directly?
Every day, thousands of innocent plants are killed by vegetarians.
Help end the violence EAT BACON
|
|
|
|
|
yes and it works perfectly. I am using VS2010 if that makes a difference.
|
|
|
|
|
What's the code you're using to execute the query?
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Dim dsFred = New DataSet
conn = New OleDbConnection("Provider=OraOLEDB.Oracle;User ID=test;Password=testPass;Data Source=ARC")
sql = "select level from testTable where dTime LIKE to_date('3/27/2013','MM/DD/YYYY') and station = '019654' order by dTime"
myCommand = New OleDbDataAdapter(sql, conn)
myCommand.Fill(dsFred, "fred")
Dim fred As Integer = dsFred.Tables("fred").Rows.Count
|
|
|
|
|
I notice that you are using the OleDb namespace data objects and not the OracleClient objects.
Try adding a reference to System.Data.OracleClient.dll and use the OracleClient.OracleConnection, OracleClient.OracleCommand, and OracleClient.OracleDataAdapter objects.
|
|
|
|
|
That's a funny Oracle feature. LIKE with a date/datetime field does not make sense, I think. But I learned that "The date column will be implicitly converted to a character string (according to nls_date_format) before the comparison" (https://forums.oracle.com/forums/thread.jspa?threadID=2132385[^]) with Oracle. Never did I expect such a nonsense. What's your requirement behind that LIKE?
And I guess that the cited text shows the reason for the failure in one situation and the success in another: the nls_date_format differs.
|
|
|
|
|
What I am trying to do is capture any records that happened that day. Where it is a datetime field there are 24 records during that time period. I can always put in qualifers for midnight to midnight however I thought the LIKE would work. I will have to try the other way I guess...
|
|
|
|
|
Hi,
I'm hiding a process with the api
<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
Private Function ShowWindow(ByVal hwnd As IntPtr, ByVal nCmdShow As ShowWindowCommands) As Boolean
End Function
I call that api with this code
ShowWindow(p.MainWindowHandle, ShowWindowCommands.Hide)'ShowWindowsCommand is an enum
that works
After that I'm have an option to show it again.
I use this code
Dim h As IntPtr = FindWindow(vbNullString, cms.Text)
If h <> 0 Then
ShowWindow(h, ShowWindowCommands.Show)
UpdateWindow(h)
MsgBox("restored")
End If
The handle h is fine but I the window do not restore. I also tryed sw_restore
What else can I do?
Jan
|
|
|
|
|
jan212r wrote: I'm hiding a process with the api
No, you're not. You're hiding a window. A process is an entirely different concept.
jan212r wrote: What else can I do?
Try sending the window the WM_PAINT message.
|
|
|
|
|
Your right of course I'm hiding a window from a process. So I added:
Dim rec As APIKit.RECT
GetClientRect(h, rec)
InvalidateRect(h, rec, True)
UpdateWindow(h)
without luck
I pleased is complete code on http://users.telenet.be/janr/MouseHook.zip[^]
Please keep in mind that I 'm testing what is possible and that there is a loot of nonsense in the code
The idea is to hide a window when I'm clicking with the middle mouse button and that I restore through a icon in the system area
modified 29-Apr-13 8:50am.
|
|
|
|
|
The code looks good, so I question the values you're using.
Eddy is on the right track.
|
|
|
|
|
jan212r wrote: What else can I do?
Verify the value of your enum[^].
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
my enum
Enum ShowWindowCommands
Hide = 0
ShowNormal = 1
ShowMinimized = 2
ShowMaximized = 3
Maximize = 3
ShowNormalNoActivate = 4
Show = 5
Minimize = 6
ShowMinNoActivate = 7
ShowNoActivate = 8
Restore = 9
ShowDefault = 10
ForceMinimized = 11
End Enum
|
|
|
|
|
jan212r wrote: my enum
Posting it here is hardly the same as comparing it. Your enum-declaration is not a UINT , but defaults to INT . I suggest you use the version from the P/Invoke website, preferably with the same name. Below code works;
Imports System.Runtime.InteropServices
Imports System.IO
Imports System.Diagnostics
Module Module1
<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
Private Function ShowWindow(ByVal hwnd As IntPtr, ByVal nCmdShow As WindowShowStyle) As Boolean
End Function
Private Enum WindowShowStyle : uint
Hide = 0
Show = 5
End Enum
Sub Main()
Dim p = Process.Start("calc.exe")
Console.WriteLine("Any key to hide")
Console.ReadKey()
ShowWindow(p.MainWindowHandle, WindowShowStyle.Hide)
Console.WriteLine("Any key to show")
Console.ReadKey()
ShowWindow(p.MainWindowHandle, WindowShowStyle.Show)
End Sub
End Module
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
thanks both.
It was the dllimort that was wrong.
<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
Private Function ShowWindow(ByVal hwnd As IntPtr, ByVal nCmdShow As WindowShowStyle) As Boolean
I didn't look into that becaurse the hide worked fine. So My idee was if 1 works, all works.
thx again
|
|
|
|
|
Hehe. Assumption is the mother of all _______ups.
|
|
|
|
|
Structure Appearance
Dim height As Double 'inches
Dim weight As Double 'pounds
End Structure
Structure Person
Dim name As String
Dim stats As Appearance
End Structure
Private Sub btnDisplay_Click(...) Handles btnDisplay.Click
Dim personl, person2 As Person
Dim person1 As String = Michael
(missing lines –come from a, b, c, d, & e listed below)
End Sub
(a) Give person, the name Michael
(b) Set Michael's height and weight to 71 and 190, respectively.
(c) Give person2 the name Jacob.
(d) Set Jacob's height and weight to 70 and 175, respectively.
(e) If one person is both taller and heavier than the other, display a sentence of the form
|
|
|
|
|
It seems rather elementary but If you take a look at the code below:
Dim strFileName As String
Dim dlgXLS As New CFileDialog
With dlgXLS
.Title = "Choose a Spreadsheet"
.Filter = "Excel (*.xls)|*.xls|All Files (*.*)|*.*"
.Flags = ofnFileMustExist OR ofnExplorer
If OpenFileDialog() Then
strFileName = .FileName
End If
End With
Set dlgXLS = Nothing
I assume that you would write somehting like:
Dim personl, person2 As Person
person1.Name = "Mic"
person1.Stats.Height = 170
etc.
|
|
|
|
|
This reeks of homework.
We're not going to do your homework for you.
|
|
|
|
|
Dear all,
could you please help me I would like to read this line "StudentName PlaceOB Education Age Sex RegDate" column and retrieve this date 4 textbox.
|
|
|
|
|
So look for the last space character in the string. Everything after that should be the date. Use Date.TryParse to try and convert it to a DateTime object and you're done.
|
|
|
|
|
Hi,
I'm facing a problem about how to zip the folder by using vb6. I hope that can get help from all of you.
Thank you.
|
|
|
|
|
wsun87 wrote: I'm facing a problem about how to zip the folder by using vb6.
Execute an external app to do the zipping. It's strongly advised not to write any new code in VB6. The language is no longer sold nor supported.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hi all,
Take a look at:
http://www.codeguru.com/vb/gen/vb_graphics/fileformats/article.php/c6743/Zip-and-Unzip-Using-VB5-or-VB6.htm
It looks great anyway.
(sorry about then link in text mode, i still did'nt find how it works)
See you
|
|
|
|