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

VB6 application program on Windows 7/8 64bit

$
0
0
Does VB6 application program(32bit app) work fine on 64bit Windows without any failure?
If there can be some problem, which part is mostly issued?
And, in case of error, how could I change code for 64bit OS?

[RESOLVED] Generate numbers in a Textbox

$
0
0
Code:

Private Sub Command1_Click()
List1.List(List1.ListIndex) = Text1 + 1
End Sub

Private Sub Timer1_Timer()
Text1.Text = List1.ListCount
End Sub

Hi everyone,

I've been trying to generate numbers starting from a specific giving number using a Textbox, Listbox, and a Timer.
But so far I have only been able to generate or add numbers starting from number 1 on the Listbox from the Textbox.
Thats because of the method I am using maybe? since this code works base on each line being counted from the Listbox.
The idea was to generate numbers in a Textbox starting from a giving number, like starting from number: 156, etc.
My project consists of a Textbox, Listbox, Timer, and a button, is there a better way to accomplish this task?
I must add that the numbers generated must be added to the listbox since I will be joining them with extra data.
Any help will be very appreciated.

vb6 setup problem

$
0
0
Dear Sir

I have a vb6 setup problem.My project is made up of vb6 and crystal reports 7
Whenever I create a setup ,I won't be able to create one due to problems which I have affixed here:

Q.The file C:\Documents and Settings\omsairam\Locals~1\Temp\msftqws.pdw\$(DllSelfRegisterEx) could not be registered beacause

it was not found

ans.

q.C:\Windows\Systems32\ mscvrt.dll file is in use". how to close it

q. how to find the dependence info. for file msado20.tlb

q. how to find the files which package is unable to find : 1.crystal 2.u25store.dll 3.u25total.dll




Solution would be highly appreciated.


Vikas jain
Attached Files

Browse through PDF pages

$
0
0
Hello :)

I have a .pdf file that I need to open at a certain page (page's number is the argument of a Sub) and I want to read it using Acrobat Reader.

There's a way to open the file directly to that page with Sheel command?

Thanks you all,

bye :wave:

[VB6] Make a collection of StdPictures, copy from PictureBox

$
0
0
I've been browsing google awhile but I can't fugure out how to solve this problem.

I have a form with a picturebox.
I want to plot something on it, store the picture (somehow) in a collection, then clear the picturebox and make another plot, repeating the process.
When I have all the pictures stored (sometimes up to 200 pictures) I want to be able to draw any of them to the picturebox in any order that I want.
And I need a collection because sometimes I'll have to remove some pictures and add some others.

The easy way is to create many invisible pictureboxes at runtime ant the render or bitblt the pictures, but I'm looking for a more professional way.
I've been trying to use PaintPicture and Render to copy the image from the picturebox to a stdpicture object, but it doesn't work because the stdpicture has no DC.

Note that I don't need to do any modification to the images after being stored.

Is there any simple way to do it? I'm stuck :(

Deleting rows from a CSV file, based on date column value.

$
0
0
I'm struggling with what seemed like a simple task in the beginning.
I need to delete rows of a CSV file based on the Date column, like Delete any Date > Reference value.
Or write any row with Date < reference value to a new CSV file with column names.

Example data structure: data1,data2,data3,data4,Date,data6,data7.

I'm doing a very similar task already to create recordsets for datareports.

So my weakness is getting the Selected recordset converted back to CSV file form.

Any help greatly appreciated.

please Convert PHP script to VB6.

$
0
0
PHP Code:

function decode($data$key ''){
    
$dec_data "";
    if (
$key == '')
        
$key 'mykey';
    
$bin_data pack("H*"$data);
    while (
strlen($bin_data) > 0) {
        
$dec_len = (strlen($key) < strlen($bin_data)) ? strlen($key) : strlen($bin_data);
        
$dec_src substr($bin_data0$dec_len);
        
$key_src substr($key,  0$dec_len);
        
$dec_data .= $dec_src $key_src;
        
$bin_data substr($bin_data$dec_len);
    }

    return 
$bin_data;
}
function 
encode($data$key ''){
    
$enc_data "";
    if (
$key == '')
        
$key 'mykey';
    while (
strlen($data) > 0) {
        
$enc_len = (strlen($key) < strlen($data)) ? strlen($key) : strlen($data);
        
$enc_src substr($data0$enc_len);
        
$key_src substr($key,  0$enc_len);
        
$enc_data .= $enc_src $key_src;
        
$data substr($data$enc_len);
    }
    return 
bin2hex($enc_data);


please Convert PHP script to VB6.

Thankyou.

Formatting seconds into HH:MM:SS using SQL string syntax question.

$
0
0
I've used this method with Date Diff with two time/date fields with recordsets without issues, but I'm failing to achieve correct syntax to format a single value in seconds into HH:MM:SS format. ie, 220 seconds = 00:03:40.

My SQL string yields a blank datareport with the iSQLStr1 un-commented, and returns results (with seconds) when it is commented, see below. Data source ADODB recordset from a CSV file.

[CODE]
'rs.Field: Elapsed, in seconds
iSQLStr1 = "Format(Int(Elapsed)/3600),""00"") & "":"" & Format((Int(Elapsed)/60)-Int(Elapsed)/3600)*60),""00"") & "":"" & Format((Elapsed) Mod 60),""00"") AS Duration "
iSQLStr = iSQLStr1 & "SELECT TOP 25 * FROM Data.csv ORDER BY Duration DESC"

Using a single SQL string:
Code:

iSQLStr1 = "Format(Int(Elapsed)/3600),""00"") & "":"" & Format((Int(Elapsed)/60)-Int(Elapsed)/3600)*60),""00"") & "":"" & Format((Elapsed) Mod 60),""00"") AS Duration SELECT TOP 25 * FROM Data.csv ORDER BY Duration DESC"
Gives a 'DataField 'Duration' not found' error, when Datereport is loaded.

Any assistance greatly appreciated.

Search string for regular expression and then save these in a variable.

$
0
0
Hi first :)

am new here and am working with VBA are me my first time, currently I want to check whether a date is in a string.
This I do with regular expressions, which works well so far.

Code:

    Dim oRegExp As Object, oMatch As Object
    Dim strText As String

    Set oRegExp = CreateObject("vbscript.regexp")
    oRegExp.Global = False
    oRegExp.IgnoreCase = True 'kein case sensitive
    oRegExp.MultiLine = False
    ' Hier: Datumsangaben im Bereich 01.01.1900 bis 31.12.2099 zulassen
    oRegExp.pattern = "(0[1-9]|[12][0-9]|3[01])[.](0[1-9]|1[012])[.](19|20)[0-9]{2}"

    Set oMatch = oRegExp.Execute(p.Index.Level0_Index1)
    If (oMatch.Count = 0 Or Len(p.Index.Level0_Index1) <> 10) Then
        ' Fehler
        p.Index.Level0_Index4 = "Date False"
        p.Index.Level0_Index5 = p.Index.Level0_Index1
    Else
        p.Index.Level0_Index4 = "Date True"
        check = "True"
    End If
    Set oRegExp = Nothing
    Set oMatch = Nothing


Now I would like to save this date wich have he find in a string.
I have no idea in which way i can do this.

Can someone please help me?

Thanks in advance.

regards

loop in sql query

$
0
0
How can I do for next statement in sql statement ? I intend to do like

(\SELECT
c1.fieldname1,
c1.fieldname2,
c2.fieldname3
FROM table1 c1

for i=1 to c1.fieldname1
left join table1 c&i on c&i.fieldname=c&i.fieldname and c&i.fieldname
next i


I tried but syntax error.

VF600 Biometric ZK SDK Visual Basic 6

$
0
0
Hi from Argentina. I need to programm a new soft for a small school. They bought a VF600 Biometric to control the personal that works there.

Someone make or have a code in VB6 to read the data from de VF600?

I have to make some reports when the theachers arrive late, for example. Sorry my english, thanks in advance.- Mi mail is silvadv@gmail.com

PD: It's came with an sdk (ZKemKeeper.dll)

Tip: Little Known Registry Setting Prevents GDI+ From Loading Images

$
0
0
Just discovered this today & played with it, so I thought I'd make some of you aware of it; those that care.

Many use GDI+ for loading image formats and the system does too, i.e., Picture & Fax Viewer for example (at least on XP). However, on XP and later, registry settings were introduced that allows a user or sysadmin to prevent up to 6 image formats from being parsed by GDI+. These formats are:
- PNG
- TIFF
- JPG
- GIF
- ICO
- BMP

So, should you get any feedback asking why your app doesn't display any of those image formats, though you are pretty sure it should, may want to ask them to take a peak at their registry settings

If any of your code assumes that the codec for any of those formats will always be available when saving to those formats using GDI+, you should verify that first else your code likely to hit an unhandled error.

Text Data not displaying correctly in Spreadsheet Control

$
0
0
Hi,

I'm using the Spreadsheet control from OWC11 strictly in a VB6 Application.

Code:

With Spreadsheet1
    For aa = 1 To RecordsCounted
        .Cells(aa, 1) = Trim$(EventData(aa).RealTime)
        .Cells(aa, 2) = Trim$(EventData(aa).RecordIndex)
        .Cells(aa, 3) = Trim$(EventData(aa).EventText)
        .Cells(aa, 4) = Trim$(EventData(aa).EventIndex)
    Next aa
End With

When I highlight Trim$(EventData(aa).RealTime) and view (Shift-F9) it shows: 6/1/2015 11:46:32AM
When I highlight .Cells(aa, 1) and view (Shift-F9) it shows: 6/1/2015 11:46:32AM

These are the same and correct.

However, when I view the actual Spreadsheet the cell shows: 6/1/2015 11:46

I need the cell data displayed to be exactly as the Trim$(EventData(aa).RealTime) shows.

I'm thinking the problem is some setting, but I can't find it.

Can someone assist?

Thanks!

inet ftp upload textbox.text

$
0
0
i have this code it work for file upload, but i need upload on text1.text on my form
With Inet1
.URL = "ftp://Yoursite.com"
.UserName = "YourUserName"
.Password = "YourPassword"
.Execute , "PUT C:\YourFile.txt /YourText.txt"
End With

how can i upload only text1.text to my ftp?
i try .Execute , "PUT text1.text"
but not work
help!!!

[RESOLVED] Text Data not displaying correctly in Spreadsheet Control

$
0
0
Hi,

I'm using the Spreadsheet control from OWC11 strictly in a VB6 Application.

Code:

With Spreadsheet1
    For aa = 1 To RecordsCounted
        .Cells(aa, 1) = Trim$(EventData(aa).RealTime)
        .Cells(aa, 2) = Trim$(EventData(aa).RecordIndex)
        .Cells(aa, 3) = Trim$(EventData(aa).EventText)
        .Cells(aa, 4) = Trim$(EventData(aa).EventIndex)
    Next aa
End With

When I highlight Trim$(EventData(aa).RealTime) and view (Shift-F9) it shows: 6/1/2015 11:46:32AM
When I highlight .Cells(aa, 1) and view (Shift-F9) it shows: 6/1/2015 11:46:32AM

These are the same and correct.

However, when I view the actual Spreadsheet the cell shows: 6/1/2015 11:46

I need the cell data displayed to be exactly as the Trim$(EventData(aa).RealTime) shows.

I'm thinking the problem is some setting, but I can't find it.

Can someone assist?

Thanks!

Connecting VB6 application to SQL Server 2012

$
0
0
Hi Group --
I have been tasked to connect a VB6 application to a SQL Server 2012 database. My organization upgraded about 6 months ago to Windows 7 virtual workstations and SQL Server 2012. The original application is still working on an XP workstation connecting to an SQL Server 2005. I am having problems using the old connection string to connect to the new SQL server.

The values for the connection string are populated through an .ini file that contains the following parameters:
-------------------------
SERVER=ARCWS4
DATABASE=Reliant
ISSQL=True
DBFILE=
PROVIDER=SQLNCLI.1 (I have loaded the Native SQL 2005 client loaded on the PC)
-------------------------

Using a .udl file to confirm the connection string renders the following:
[oledb]
; Everything after this line is an OLE DB initstring
Provider=SQLNCLI.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Reliant;Data Source=ARCWS4

Here are the errors I am receiving when I try access the data:
"Invalid connection string attribute"
"Cannot create database source recordset"
"Login failed for user ' '. The user is not associated with a trusted SQL server connection". [Note: Login have been created on the SQL Server]

I have attached the text of the clsData object that configures the data connection from the above mentioned .ini file. In a perfect world I would like to tweak the .ini file since I am not the original author of the code and am afraid that other problems can emerge if I start messing with it.

Any help or direction would be appreciated
Attached Files

move to next line on multiline textbox

$
0
0
i been trying to make text1.text = current line at top in multiline textbox

On Error Resume Next
Dim strText() As String

strText = Split(Text14.Text, vbCrLf)

List1.AddItem strText(0) 'strText array is zero-based so first line has index 0.

Dim lineBegin As Long, lineEnd As Long
Dim curPos As Long

curPos = Text14.SelStart + 1

'Find where the line begins and ends
lineBegin = InStrRev(Text14.Text, vbCrLf, curPos)
lineEnd = InStr(curPos, Text14.Text, vbCrLf)

'Account for the possibility that you are on
'the top line, or the bottom line (or there's only one line),
If lineBegin = 0 Then lineBegin = -1
If lineEnd = 0 Then lineEnd = Len(Text14.Text) - 1

'Remove the line
Text14.Text = Left$(Text14.Text, lineBegin + 1) & Mid$(Text14.Text, lineEnd + 2)


problem is next line stay at bottom! i need to move next item to top
otherwise the whole textbox gets removed

what i wana to move first line from multiline textbox to text1.text
plz help

[RESOLVED] how to end application from dll call

VB Application connection string problems - connecting 64-bit Windows Clients to SQL

$
0
0
My agency has upgraded from Windows XP clients to Windows 7 64-bit clients. They also upgraded the SQL server from SQL 2005 Express to SQL 2012.

They have a Visual Basic 6 application that successfully connects to the SQL 2005 express server from a Windows XP machine using the 2005 SQL Native client. My task is to successfully connect VB application from the 64-bit Windows machines to SQL Server 2012. I am using the SQL Server 2012 native client.

I have created a .udl file to ensure I am using the correct connection string. I have copied that string several time and several different ways and I continue to receive the following errors:
"Invalid connection string attribute"
"Cannot create database source recordset"
"Login failed for user ' '. The user is not associated with a trusted SQL server connection".

The application populates the information from a .ini files that reads:
SERVER=ServerName
DATABASE=Database Name
ISSQL=True
DBFILE=
PROVIDER=SQLNCLI11.1
(I would like to tweak the .ini file instead of messing with the VB application)

According to the .udl files the connection string should look something like this:
[oledb]
; Everything after this line is an OLE DB initstring
Provider=SQLNCLI11.1;Integrated Security=SSPI;Persist Security Info=False;User ID="";Initial Catalog=Reliant;Data Source=ARCWS4;Initial File Name="";Server SPN=""

I have also look at www.connectionstring.com and I still cannot get the correct parameters. I still receive the errors mentioned above.

I have attached the Visual Basic class that creates the connection string.

I have checked the SQL server and compared the old with the new server parameters and cannot seem to find any differences. Everything seems to be in order.

Any help would be appreciated
clsData.txt
Attached Files

Read .txt file and place data in textbox

$
0
0
I have this .txt file

Department Name No. Date/Time Location ID ID Number VerifyCode CardNo

OUR COMPANY "tiago ,bilia" 2 5/4/2015 8:44 1 Fingerpint
OUR COMPANY "tiago ,bilia" 2 5/5/2015 8:49 1 Fingerpint
OUR COMPANY "tiago ,bilia" 2 5/7/2015 8:39 1 Fingerpint
OUR COMPANY "tiago ,bilia" 2 5/7/2015 18:31 1 Fingerpint
OUR COMPANY "tiago ,bilia" 2 5/8/2015 8:51 1 Fingerpint
OUR COMPANY "tiago ,bilia" 2 5/8/2015 18:32 1 Fingerpint
OUR COMPANY "tiago ,bilia" 2 5/11/2015 8:43 1 Fingerpint
OUR COMPANY "tiago ,bilia" 2 5/11/2015 18:50 1 Fingerpint

Is there any way that i can place the data in textbox to be save later in msaccess?

I know a little of vb6 but i havent tried to use txt file before.

Thanks for the time..
Viewing all 21856 articles
Browse latest View live


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