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 &...
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.
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...
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...
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...
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)
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...
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 :(
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)
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?
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"...
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
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...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.