Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all 21696 articles
Browse latest View live

Automation Error

$
0
0
i use WebClient (from file system.tlb)

Code:

ClientId = "xxxx"
Public Function UploadImage(image As String) As String
Dim wc As System.WebClient
'create WebClient
    Set wc = New System.WebClient
      Call wc.headers.Add("Authorization", "Client-ID " & ClientId) >>>> error here
.
.
.

please help

[RESOLVED] parse code from VB NET to vb6

$
0
0
'Declaration
Public Property Headers As WebHeaderCollection

how to parse that code to VB6

found: tool>add procedure....

[RESOLVED] Need help in split text

$
0
0
Dear Guru,

I have 2 Textbox and 1 Command

Text1.text is user enter
when Text1.text = "celvin [6] has entered"
command1 click
text2.text = "celvin"

i want to make it base on "has entered"
if not "has entered"
text2.text = ""

my code is:

Private Sub Command1_Click()
Dim myStr As String

If Text1.text = "" Then
Else
myStr = Split(Text1.text, " [")(0)
Text2.text = myStr
End If
End Sub

but when text1 enter "aaaa" text2 still showing "aaaa"
how can i fix it please someone help thank :confused: :confused:

Help Full code Need help to parse it from C# to VB6

$
0
0
This is the code i need to parse:

Code:

string ClientId = "******";
        public string UploadImage(string image)
        {
            WebClient w = new WebClient();
           
            w.Headers.Add("Authorization", "Client-ID " + ClientId);
          // MessageBox.Show((w.Headers.ToString()));
           

            System.Collections.Specialized.NameValueCollection Keys = new System.Collections.Specialized.NameValueCollection();
            try
            {
                //'Encode64(Byte/binary)
                Keys.Add("image", Convert.ToBase64String(File.ReadAllBytes(image)));
               
                byte[] responseArray = w.UploadValues("https://api.imgur.com/3/image", Keys);
                dynamic result = Encoding.ASCII.GetString(responseArray);
               
                System.Text.RegularExpressions.Regex reg = new System.Text.RegularExpressions.Regex("link\":\"(.*?)\"");
                Match match = reg.Match(result);
                string url = match.ToString().Replace("link\":\"", "").Replace("\"", "").Replace("\\/", "/");
                return url;
            }
            catch (Exception s)
            {
                MessageBox.Show("Something went wrong. " + s.Message);
                return "Failed!";
            }
        }

Adding to a Word Document -VB6

$
0
0
I have a word document and it's in the form of a letter. I want to open this document replace the name address ect from data from the app and save the new word document as something else.

Code:

{Letter Date}

{Name}
{Name2}
{Mailing Address}
{Mailing City State Zip}


Dear {Name}:

This would be the header part of the word doc I want to just replace the text inside the {} with data from the app. There are other instances of {} throughout the word document that I would want to replace as well. If someone could get me started that be awesome..

Connection To Server

$
0
0
Hi

To connect to server below is the code . If due to some reasons server is down it takes a long time to give error message

cnn2 is to connect to server

If cnn2.State Then cnn2.Close
cnn2.Open "Driver=SQL Server;Server=" & SvrName & ";Database=" & "test" & ";uid=" & Suid & ";pwd=" & Spwd & ";"

cnn2.BeginTrans
On Error GoTo errhandler

str = "Insert statement"
cnn2.Execute str
cnn2.CommitTrans

VB6.0 A simple USB Problem

$
0
0
Hello everyone,

I just want to have two simple push buttons connected to the computer via USB and when I run the program and push one of these buttons, I want the computer to tell me which button is pressed. Any helps will be appreciated!

Thanks.

Please explain how these functions work

$
0
0
These are some of the functions inside VB 6 (MSVBVM60.DLL)

__vbaFreeStr
__vbaPowerR8
__vbaFPInt
rtcStrFromvar
rtcRightCharBstr
__vbaFreeStrList
__vbaLenBstr
rtcMidCharBstr
rtcAnsiValueBstr
__vbaStrCat
__vbaFreeVar
rtcR8ValFromBstr
rtcBstrFromAnsi


Please provide the prototype for these API functions.

I need to know what are the arguments for these functions and what these functions do and what is the result of these functions.

Adding multiple controls

$
0
0
How can I add a string of, say, textboxes and have them numbered in order rather than reverse order?

I add 5 or 6, copy all, paste all, until I have a full row (over 20). Their index values are in order. Copy a row and when pasted all the index values added are reversed. How do I prevent this reversal?

Safty USB Remover

[RESOLVED] Safty USB Remover

[RESOLVED] How to fix an item to a panel

$
0
0
Hey guys! I registered so I could ask this question. Any help would be greatly appreciated!
I recorded a vid since it's easier to ask that way.

https://www.dropbox.com/s/tl3ar0rktc1p1lw/VB6.wmv

If you're going to explain something, please be thorough. I am a complete novice, so if you tell me to do something I will have no idea what you're talking about. I would appreciate thorough instructions on how to do it. Thank you very much.

Webclient.Headers problem

$
0
0
i cant use Headers in VB6
it saied error why?

Fingerprint scanner

$
0
0
Hello All,

I am new to this site and i am not expert in Vb6.0. Just beginner , i have a problem in communicating to the
Finger print scanner . i use essl e9 product . i had tried using zktime5.0 software and i am able to connect and communicate to the device . I have no coding idea. could you please help me to connect and communicate to the device.

My requirement is simple . I need to Register the member with finger print and store in Ms Access and authenticate using fingerprint by retrieving the data from Access. I am struggling from the beginning . help plzzz. Thanks in advance.

[RESOLVED] Assigning one array to another

$
0
0
I have two arrays, both integer arrays where Array1 is indexed 0 thru 128 and Array2 indexed 0 thru 256

I thought I could assign one array to another by just using a single line like this:

Array2 = Array1 or Array2() = Array1()

but doing this I get a Type Mismatch error. So, can it not be done this way and I need to use a For....Next loop

[RESOLVED] object variable not set rs.movenext and wend dosnt work prpoer

$
0
0
i am trying to display last backup date from the database
i get object variable not set before i closed the recordset why?
i used wend and rs.movenext why is this?
Code:

      Set rs = CN.Execute("SELECT BackDate,BackHour FROM BackUpLogs")
          While Not rs.EOF
        If rs.RecordCount = 0 Then
        Set Pane = StatusBar.AddPane(ID_BAKCUPCHECK)
            Pane.Text = "no backup found"
            Pane.Visible = True
            Pane.IconIndex = 636
            Pane.TextColor = &H800000
            Pane.Font.Size = 12
            Pane.Font.Bold = True
            Pane.RedrawPane
            Pane.Alignment = 0
            Pane.Style = SBPS_NOBORDERS
         
    Else
       
        Set Pane = StatusBar.AddPane(ID_BAKCUPCHECK)
            Pane.Visible = True
            Pane.Text = "Last Backup in the system" & " " & rs!BackDate'here i get object variable not set
            Pane.Font.Size = 12
            Pane.IconIndex = 635
            Pane.Font.Bold = True
            Pane.RedrawPane
            Pane.Alignment = 50
            Pane.Style = SBPS_STRETCH
            End If
            rs.MoveNext
            Wend

Connection Test

$
0
0
Hi

Below is my test connection . I want if it is successful it should return .T. else
.F.

Public Sub ConnectionTest()
Set cnn2 = New ADODB.Connection
On Error GoTo errhandler

' On Error Resume Next
cnn2.Open "Driver=SQL Server;Server=" & ServerName & ";Database=" & "Test" & ";uid=" & uid & ";pwd=" & pwd & ";"


If cnn2.State = adStateOpen Then

Else
MsgBox "Connection Failed", vbExclamation
End If
Exit Sub

errhandler:
If err.Number <> 0 Then

MsgBox err.Number & err.Description & err.Source

End If

Thanks

Auto increment Alphanumeric

$
0
0
Hi,

I need to autoincrement an alphanumeric string.
E.G.
PL01 ... PL99 ... PL01A ... PL99A ... PL01AB to ZZ (location Point place)
TO01 ... TO99 ... TO01A etc. (location Toronto)
ASS001 ... ASS999 ... ASS001A etc. (location Assomption)

The alpha part is based on a location selected from a combo box in my form. The alphanumeric string needs to go into a subform for each sample I receive. I select the location the samples are received from and I record the sample and its info into the sub form. (single user database)

I know this is a tough one. I need to use Dmax and link it to my COC sub form which has the current Alphanumeric strings so that it can find the last one +1.

PS. I did not select these terrible alphanumeric strings, but I am stuck wth them.

Cheers

Urgent Looking for Old OCX Components

$
0
0
Hi All,
I'm looking for old components, because install CDs went wrong...
My VB version is 5.0, 32bit Windows XP
I would like to have First Impression Chart install and True DBGrid32 install apps.
These are at least 10 years old components, no more copyrights on it.
Send me direct email or links please.
Thank you very much!

Standard deviation

$
0
0
Hi everyone= I can't get my code for the standard deviation to work. I have to create a program for curving grades with a median and standard deviation, and then assign letter grades to the scores.
my code for the median is :
Option Explicit

Private Sub cmdShow_Click()

Dim score(1 To 20) As Integer
Dim stanDeviation As Integer
Dim index As Integer
Call FillArray(score())
picExam.Cls
picExams.Print "There were 20 "exams"
picExams.Print "Mean:"; Sum(score()) / 20
picExams.Print "Std. Deviation: "; Round(Sqr(stDev), 5)

Private Function Sum(s() As Integer) As Integer
Dim total As Integer, index As Integer
'This will add the scores for the mean
total = 0
For index = 1 To 20
total = total + s(index)
Next index
Sum = total
End Function

Private Function Deviation(s() As Integer) As Integer
Dim index As Integer
Dim stDev As Integer
'Calculates the deviation
stDev = 0
For index = 1 To 20
stDev= stDev+ ((s(index) - 70.65) ^ 2 / 20)
Next index

End Function

Could anyone Tell me what is wrong with equation code? The code for the median works just fine.
Viewing all 21696 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>