Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. Andrzejek

    Update SQL's varbinary(max) field from VB6

    Update - after spending a lot of time with DBA, we could not make this process happen :( So, back to the Parameterized query. And it works! (I was so close...) Dim aryByte() As Byte Dim cmd As ADODB.Command Dim L As Long If FSO.FileExists(PDF_PATH & !FileName.Value) Then Open PDF_PATH &...
  2. Andrzejek

    Update SQL's varbinary(max) field from VB6

    I get it. I can do it on my local DB, but I need special permission to do it to other DB. I need this permission to just load the data once (I hope) so no security risk.
  3. Andrzejek

    Update SQL's varbinary(max) field from VB6

    I did try the Parameterized query, but I could not resolve the adVarBinary line Dim cmd As New ADODB.Command ... strSQL = "UPDATE SampleReport SET " & vbNewLine _ & " Body = ? " & vbNewLine _ & " WHERE SampleReportID = ?" With cmd .ActiveConnection = CnS...
  4. Andrzejek

    Update SQL's varbinary(max) field from VB6

    I have this code in VB6 application - reading PDF file into a byte array: Dim aryByte() As Byte Open App.Path & "\ABC_XYZ.pdf" For Binary Access Read As #1 ReDim aryByte(0 To LOF(1) - 1) Get #1, , aryByte Close #1 So, at this time I have my PDF in aryByte variable. Now I need to update an...
  5. Andrzejek

    Select X of each variation of a field

    Select Distinct VERSION FROM MyTable You will get: A B C Now, loop thru the outcome from above and build this SQL: SELECT TOP (1) * FROM MyTable Where VERSION = 'A' UNION ALL SELECT TOP (1) * FROM MyTable Where VERSION = 'B' UNION ALL SELECT TOP (1) * FROM MyTable Where VERSION = 'C' Run...
  6. Andrzejek

    Select X of each variation of a field

    Could you show a sample of your data in a table? And expected result.
  7. Andrzejek

    Empty recordset stops

    You can also do: If EXH.BOF = EXH.EOF Then 'No records :-( Else 'Do your magic here End If
  8. Andrzejek

    stepping through table rows

    It may not be obvious to some, but Merlijn's example was made in VB6(Classic)/VBA (Excel or any other Office app)
  9. Andrzejek

    SORT DATE in msflexgrid not correct

    It is customary here at TT to share (even your own) solution so others who may have the same issue can benefit.
  10. Andrzejek

    CREATE msflexgrid as in xlsx file

    How about this way?
  11. Andrzejek

    How can i have more than 1 line in the body of an email

    Something like: .Body = "Good Day," & vbNewLine & vbNewLine & _ "Please let this Email serve as a verbal warning" BTW, there is a separate forum for VBA Visual Basic for Applications (Microsoft)
  12. Andrzejek

    Joining 4 tables issue

    If the User does not have any Role assigned, there is nothing to display in (role's) Name column for that User (unless you want to display: 'Role not assigned' or something like that) And I see kind of poor data in your st_role table: 800 Super Administrator ... 811 Super Administrator ... 916...
  13. Andrzejek

    Joining 4 tables issue

    It looks like you have 941 Users with no Role(s) assigned to them. And that's why their st_role.sf_name is NULL Their IDs are not in st_useraccount_roles table :(
  14. Andrzejek

    Joining 4 tables issue

    I cannot see your data in your tables, so it is difficult to know what's going on. It is possible you have Users without any Role(s)? To check, run this statement: Select sf_user_id From sf_user Where sf_user_id NOT IN (Select sf_user_id From st_useraccount_roles)
  15. Andrzejek

    Joining 4 tables issue

    Add to the end of your Select: Select ..., R.sf_name, R.df_role_id From... and see if you get id's for these NULLS. Is it possible you have some Roles without their names in st_role table?
  16. Andrzejek

    Joining 4 tables issue

    With your setup, I would assume every User belongs to just one Department, and can have at least one role, but user can be assigned more than one role, hence the st_useraccount_roles table. If that's true, I would try: SELECT U.sf_firstname as "First Name", U.sf_lastname as "Last Name"...
  17. Andrzejek

    set nothing form1

    You don't "put this code in command button". In the cmd you just need: Unload Me and the rest (setting form to nothing) is done in Private Sub Form_QueryUnload
  18. Andrzejek

    set nothing form1

    Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) Set Form1 = Nothing End Sub
  19. Andrzejek

    Auto changing of small font sizes

    In VB6, all *.frm (form) files are just text files and you can open them in Notepad, for example. You are going to see something like below which you can change, save, an re-open in VB6 IDE VERSION 5.00 Begin VB.Form Form1 Caption = "Form1" ... StartUpPosition = 3 'Windows...
  20. Andrzejek

    Commas in CSV fle

    I would try something simple, like: Dim strText As String strText = "This is,my test,for commas,the,end" strText = Chr(34) & Replace(strText, ",", Chr(34) & "," & Chr(34)) & Chr(34) Debug.Print strText

Part and Inventory Search

Back
Top