Search:

Type: Posts; User: pnish

Page 1 of 13 1 2 3 4

Search: Search took 0.64 seconds.

  1. Re: Using OleDB Command Builder against Access DB fails

    Brilliant! That did the trick, thanks very much.

    Cheers
  2. [RESOLVED] Using OleDB Command Builder against Access DB fails

    I've previously used SQLCommandBuilder with SQL Server without issue. I'm trying to replicate that using OleDB against an Access 2007 database without success.
    I'm using VB.Net, Visual Studio 2019...
  3. Replies
    24
    Views
    50,749

    Re: Input Wanted: 3rd Party Products

    ClosedXML is a wrapper for Microsoft's OpenXML library, specifically for creating Excel spreadsheets. I love it!
    https://github.com/closedxml/closedxml/wiki
  4. Re: Getting SMART data, have code, but trouble with output

    As far as I can see from the code the status of each of the drive parameters is returned in Drive_Info.Attributes(i).StatusFlags.

    In the Combo1_Click event you'll see a line commented out. That...
  5. Replies
    1
    Views
    654

    Re: Custom scroll button possible to scroll?

    One simple way to do it would be to set a flag in the label's MouseDown event and reset it in the MouseUp event. Use a timer to check the value of the flag and perform the appropriate action, eg...
  6. Re: Getting SMART data, have code, but trouble with output

    I found a couple of bugs in the original code. Check out the attached project... it seems to be doing the right thing now. I had to comment out a line in the GetDriveInfo() function to make it...
  7. Re: Getting SMART data, have code, but trouble with output

    Go to the ReadAttributesCmd() function in modSMART. In the For|Next loop there is a line of code commented - remove the comment and all should be well.

    Cheers

    Pete
  8. Re: Add Primary Key to existing Access table using SQL

    It's OK, I found how to do it....
    create index [PrimaryKey] on [tablename] ([field1],[field2],[field3]) WITH PRIMARY

    Can I give myself rep points? :)
  9. [RESOLVED] Add Primary Key to existing Access table using SQL

    Greetings

    I can create Indexes on an existing table by:
    create index [index name] on [table name] ([field to index])
    and execute this against an open ADO connection.

    Can anyone show me how to...
  10. Replies
    3
    Views
    1,065

    Re: crystal report 8 code for vb 6 and MS Acess

    CrystalReport1.ReportFileName = App.Path & "\" & "reports\Category.rpt"
    CrystalReport1.SetTablePrivateData 0, 3, rstResult
    CrystalReport1.Destination = crptToPrinter
    CrystalReport1.Action = 1...
  11. Replies
    3
    Views
    975

    Re: unable to load report

    Your syntax looks OK. What version of Crystal are you using? Are you using the Crystal OCX? Does the error message provide any more specific information?
  12. Replies
    4
    Views
    1,313

    Re: Substring & Datalength

    That's right, SUBSTRING will return 4 characters starting from position DATALENGTH(BARCODE) - 3), ie 7. So it will return the characters in positions 7, 8, 9 and 10
  13. Replies
    4
    Views
    1,313

    Re: Substring & Datalength

    Does your DB have a RIGHT function (or similar)?

    You could then do: RIGHT(BARCODE, 4) to return the last 4 digits

    otherwise, if your SUBSTRING function behaves the way I think, try:...
  14. Replies
    9
    Views
    1,110

    Re: Data of some Records does not appear in CR9

    No, probably not. I'ts just a habit of mine.
  15. Replies
    9
    Views
    1,110

    Re: Data of some Records does not appear in CR9

    Underlay causes following sections to be placed underneath. For example:

    Section1: This is text from section one
    Section2: ------------------------------------> This is text from section two
    ...
  16. Replies
    9
    Views
    1,110

    Re: Data of some Records does not appear in CR9

    It's because there's 2 records so each record is displayed on a separate line of the report. Usually you could set the 'Underlay Following Sections' property in the Section Expert and that would fix...
  17. Replies
    2
    Views
    456

    Re: Database Delete

    Is the Account field numeric or text?
    Why are you doing this inside a loop?

    It's a good habit to wrap field and table names etc in brackets, eg
    StrSql = "DELETE FROM [" & StrSql & "] WHERE...
  18. Re: A cup of Boarderless Forms, anyone?

    Try this:

    Private Sub Form_Activate()

    Me.WindowState = vbMaximized

    End Sub
  19. Replies
    5
    Views
    1,024

    Re: how pass values to crystal report?

    It's been a long time since I've used the Crystal OCX but I believe you need to do something like this:

    In your report create a new formula, eg ReportHeading. In the formula just place two empty...
  20. Replies
    9
    Views
    1,110

    Re: Data of some Records does not appear in CR9

    The main problem I see is that when a council has BOTH a residential and an office address, 2 records are returned. That's why they're not displayed on the same line.

    You should also set the...
  21. Replies
    9
    Views
    907

    Re: Running total Problem

    I'm just guessing here... but maybe the field used to hold the running sum is too small to display the whole result. Try making the field larger.
  22. Replies
    2
    Views
    1,575

    Re: Windows NT Service

    Here's the .hlp file that comes with ntsvc.ocx if that's any use to you...
  23. Replies
    6
    Views
    645

    Re: Display number only and not text

    Great minds.... :wave:
  24. Replies
    6
    Views
    645

    Re: Display number only and not text

    If the text is always formatted in the same way you could try:

    Label1.Caption = Mid$(List1.List(List1.ListIndex), instrrev(List1.List(List1.ListIndex), " ") +1)
  25. Replies
    20
    Views
    2,860

    Re: VB Find words in string?

    Dim haystack As String
    haystack = "This is my sentence, it is very good, infact it is great! it is."

    Dim needle As String
    needle = "it is"

    Dim cnt As Long
    Dim pos As Long

    pos = InStr(1,...
  26. Replies
    3
    Views
    760

    Re: combobox change event

    A combo's Change event only fires when the text in the text box portion of the combo has changed. It works the same way as the Change event does for a normal text box so, as you've discovered, adding...
  27. Replies
    2
    Views
    555

    Re: Last Accessed Date

    One way is to use the FileSystemObject.

    In your project add a reference to Windows Script Host Object Model.
    Dim fso As FileSystemObject
    Set fso = New FileSystemObject

    MsgBox...
  28. Thread: MousePoint

    by pnish
    Replies
    1
    Views
    378

    Re: MousePoint

    Is this what you mean...

    Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

    Select Case Button
    Case vbLeftButton
    MsgBox "Left...
  29. Replies
    2
    Views
    1,042

    Re: Reading a Tab delimited text file

    Show us a sample of what your text file looks like....
  30. Replies
    5
    Views
    829

    Re: make,write,update a .ini file

    Did you look at the link that zynder provided. Using that example code, an .ini file will automatically be created if you use any of the Write... functions.
    Check the link a couple of posts up....
  31. Replies
    11
    Views
    696

    Re: Time and a message

    You use DateDiff() the same way for time, eg Dim dTime1 As Date
    Dim dTime2 As Date

    dTime1 = "10:35"
    dTime2 = "16:37"

    MsgBox "The difference is " & DateDiff("s", dTime1, dTime2) & "...
  32. Re: how to converts military time to regular time in vb 6.0

    Ditto Al42....

    Nothing's broken.. it works exactly as it should. :ehh:
  33. Re: how to converts military time to regular time in vb 6.0

    What do you mean 'it will not am or pm right'?

    Format$("22:00", "hh:nn:ss AMPM") shows 10:00:00 PM
    Format$("02:00", "hh:nn:ss AMPM") shows 02:00:00 AM

    etc
  34. Re: how to converts military time to regular time in vb 6.0

    Format$("22:25","hh:nn:ss AMPM")
  35. Replies
    8
    Views
    739

    Re: Need Help With Looping

    Exactly... that's why I said to get rid of the loop. He wants to make sure that the textbox isn't empty before continuing and a loop isn't the best way to achieve this IMHO. As leinad31 said, you...
  36. Replies
    8
    Views
    739

    Re: Need Help With Looping

    You really don't need a loop for that. Try using the LostFocus event to check that the textbox isn't blank, if it is display your message and set the focus back to the textbox, egPrivate Sub...
  37. Replies
    14
    Views
    977

    Re: EVEN not EVEN ?

    I realise that now... as I said, I misread the question.
  38. Replies
    14
    Views
    977

    Re: EVEN not EVEN ?

    Hmmmm... I may have misread the question. I was assuming he wanted Parity = 0 for an even number and Parity = 1 for an odd number. :o
  39. Replies
    14
    Views
    977

    Re: EVEN not EVEN ?

    If it's always binary then it's easy. If the righmost bit is zero, then the number is even, if it's a one then the number is odd. So all you need to do is extract the righmost digit from the string...
  40. Replies
    14
    Views
    977

    Re: EVEN not EVEN ?

    Are these strings always zeros and ones, ie binary? If so you could do this:

    Dim parity As Integer
    parity = CInt(Right$("1010101", 1))
Results 1 to 40 of 500
Page 1 of 13 1 2 3 4



Click Here to Expand Forum to Full Width