hkdani 39 Posting Pro in Training

The Timer control has a few important properties. They are pretty simple to use. But you must understand a few things:

(1) You must set the enabled property to True, before they start. Timer1.enabled = True You can do this with a command button or have the property enabled at design time. By default it is not enabled at design time.
(2) You also must understand the interval property. Each tick of the timer is worth 1 millisecond. So, you need 1000 ticks for each second: Timer1.interval = 5000 That would give you 5 seconds.

And finally, (3). You must implement your desired code in the Timer event.

Private Sub Timer1_Timer()
'  Code you wish to see occur.
'  As previously posted here: [B]Unload Me[/B] should be a good choice.
'  Many coders also use this event to turn the timer off: e.g. [B]Timer1.enabled = false[/B]
'  A nice technique is the following: [B]Timer1.enabled = Not Timer1.enabled[/B]. This toggles the timer either on or off every time the Timer Event occurs.
End Sub

You'll find the area is automatically created for you in your IDE when you click on the only available event for the Timer control in Code View. Double clicking on the Timer Control on your form will do the same.

hkdani 39 Posting Pro in Training

You could do something like the following. This would prompt for good data. The
variable strAnswer will store the answer from the user. You might want to code
to validate the user's answer, though. This is just a general idea.

Private Sub CheckData()
Dim strAnswer As String
    If Combo1.Text = vbNullString Then
        strAnswer = InputBox("Please, enter proper data", "Data Error", "0")
        If strAnswer = "0" Then
            Exit Sub
        Else
            SaveData strAnswer
        End If
    End If
End Sub

Private Sub SaveData(ByVal GoodData as String)

End Sub
hkdani 39 Posting Pro in Training

The easiest way to make a client server is to use a Microsoft Jet Database. The Jet Database engine has client and server capabilities built in. So, just have a server up and running and share the Access .mdb file on a shared folder on the server.

There are other alternatives. But this would involve the least amount of work.

The Client can log into the server share and access the access .mdb file. Several examples of setting up an access share are found in the MSDN documentation.

hkdani 39 Posting Pro in Training

As long as the fields are in the same rowset, you shouldn't have a problem. So if your recordset, for example, is the Customer Table and that table has Age and Allowance fields, then you can bind the combo box and the textbox to a data control.

Here's the procedure:

(1). Add a data control to your form.

(2). Set the connect property, the database name, and the recordsource properties of the data control in the property box of the data control at a minimum. The record source should be the row that contains the values you're looking for: Age and Allowance.

And (3). Bind the combo and text box controls to the data control. Set the Data Source property to the name of your Data Control (Data1?), and the DataField to Age (for the Combo) and Allowance (for the Text Box).

All you have to do is click on the arrows of the Data Control and the values should
change automatically as long as you have the controls set up properly.

hkdani 39 Posting Pro in Training

Whenever your working an object try to use the With statement and
include as many properties as possible.

For Each rCell In Range("S2:S462")
If rCell.Offset(0, 3).Value = 1 Then
rCell.Value = "CLICK"
ElseIf rCell.Offset(0, 1).Value = 1 Then
rCell.Value = "OPEN"
ElseIf rCell.Offset(0, 2).Value = 1 Then
rCell.Value = "BOUNCE"
ElseIf rCell.Offset(0, 1).Value = vbNullString Then
rCell.Value = vbNullString
Else: rCell.Value = "NONE"
End If
Next rCell

Change the above to the following:

For Each rcell In Range("S2:S462")
    With rcell
        If .Offset(0, 3).Value = 1 Then
            .Value = "CLICK"
        ElseIf .Offset(0, 1).Value = 1 Then
            .Value = "OPEN"
        ElseIf .Offset(0, 2).Value = 1 Then
            .Value = "BOUNCE"
        ElseIf .Offset(0, 1).Value = vbNullString Then
            .Value = vbNullString
        Else: .Value = "NONE"
        End If
    End With
Next

Microsoft recommends doing this whenever possible to improve performance by preventing the program from having to load the object again every time it appears in code. Which is what you are doing.

This should save your program from having to load the object 9 times every time it goes through one loop.

hkdani 39 Posting Pro in Training

The text property of the combo box returns the current value of the edit box according to MSDN documentation.

So, you must validate your data through code before saving it into your database. In other words, if the text in the edit box has been changed, your program must make sure that that data can actually be saved in that particular field of your oracle recordset.

You can do this in the change event of the combo control. This only works, if the style property is set to 0 or 1.

Private Sub Combo1_Change()
'  Code to validate the new value
End Sub

Otherwise, you'll have to write a function to check the data before saving it to the database.

Private Sub CheckData()
' 
End Sub
hkdani 39 Posting Pro in Training

You can use a Common Dialog Control. Add the Microsoft Common Dialog Control component to your project.

This control will return a Path to a file. Or you can use API's to do same. Little bit more flexibility.

But really. What you're requesting is not very clear at all. And I'm able to make little sense of what you really want.

If you have already opened the program, you should already know the path. Until you explain clearly what you really want to do no one can really explain to you how to do what you wish.

Here's an example of using the CommonDialog API's to return a Path.

Option Explicit
Private Const BIF_RETURNONLYFSDIRS = &H1      ' // For finding a folder to start document searching
Private Const BIF_DONTGOBELOWDOMAIN = &H2     ' // For starting the Find Computer
Private Const BIF_STATUSTEXT = &H4
Private Const BIF_RETURNFSANCESTORS = &H8
Private Const BIF_EDITBOX = &H10
Private Const BIF_VALIDATE = &H20              ' // insist on valid result (or CANCEL)

Private Const BIF_BROWSEFORCOMPUTER = &H1000  ' // Browsing for Computers.
Private Const BIF_BROWSEFORPRINTER = &H2000   ' // Browsing for Printers
Private Const BIF_BROWSEINCLUDEFILES = &H4000 ' // Browsing for Everything

Private Const OFN_READONLY = &H1
Private Const OFN_OVERWRITEPROMPT = &H2
Private Const OFN_HIDEREADONLY = &H4
Private Const OFN_NOCHANGEDIR = &H8
Private Const OFN_SHOWHELP = &H10
Private Const OFN_ENABLEHOOK = &H20
Private Const OFN_ENABLETEMPLATE = &H40
Private Const OFN_ENABLETEMPLATEHANDLE = &H80
Private Const OFN_NOVALIDATE = &H100
Private Const OFN_ALLOWMULTISELECT = …
hkdani 39 Posting Pro in Training

Oh, by the way. The reason you can't find an event to do this: you have to define your own peculiar event ID in the NOTIFYICONDATA structure (VB6 public type). You set this flag using the MyTaskBarAddIcon shell function.

hkdani 39 Posting Pro in Training

Υοu'll have to do what is called subclassing in VB6. No vb6 form by default deals with all the Windows Messages generated by the Windows Operating System. VB6 deals with a limited set of Windows Messages in its Main Window: the rest are ignored.

So you add a subclass that allows you the flexibility of dealing with whatever message you want to deal with. To do this you have to use a few WIN32 SDK API's. But the subclass intercepts or hooks the messages being delivered to your vb6.exe's window and allows you to deal with them before, after, or both before and after your vb6 application deals with the message.

You must create what is called the Windows Process in a bas module: not a class module.
The following example picks up the MouseWheel Event Message which is not listed as an event in your VB6 window. The example code picks up a mouse wheel scroll event, tells you which way it's going (negative or positive value) and then lists the current mouse position at the time of the scroll event.

Your VB6 application has its own WindowsProc function which is hidden from the programmer. This function processes the Windows Messages for your VB6 window. But you must write code to insure that your application picks up the Windows Message before VB6. You do this by setting what is called a Hook. The Hook will use the handle of your vb6 application and with a …

hkdani 39 Posting Pro in Training

You should have two codes listed in the Product Information Tab of the Properties Menu for your program: (1) the Product Code, and (2) the Upgrade Code. Microsoft says that you should change the product code, but leave the Upgrade Code the same.

This allows newer versions of the MSI (1.1 or higher) to uninstall older versions of the program and replace them with newer components. When you change controls, the installer picks up the changed version also.

However, for the VB6 environment, I don't believe there exists any such animal as a patch. This makes installing upgrades for VB6 programs larger than necessary in some instances.

hkdani 39 Posting Pro in Training

Printer.Print "This is what I want to print."

hkdani 39 Posting Pro in Training

ok thankzz btw

No problem. The way I learned how to hook up to SQL Server was first in SQL Server itself--outside the VB6 environment.

It's really hard to jump into the fire without knowing where or how you're going to land. Once you have some experience setting up the SQL environment with a database, then you should be able to recognize which connection strings to use and the proper parameters. As far as I recall, it wasn't that hard. I believe they had a quick start or quick set up section in the SQL Server help section. Should provide all you need to know for setting up your vb6 environment.

hkdani 39 Posting Pro in Training

Asalam to every one im a begnner in programming hoew can i send an email through vb exe
please help me in under standing:(

Use mapisession control and the mapimessage control.

Use the mapisession to sign on and mapimessage to send and receive messages.

It should work in conjunction with Microsoft Outlook Express.

In the msdn documentation look under using the MAPI controls. The MSDN cd's also provide a sample VB6 MAPI application to help you out.

http://msdn.microsoft.com/en-us/library/aa733653%28v=VS.60%29.aspx

hkdani 39 Posting Pro in Training

Correction: Set Printer = Printers(intPrinterToUse) It's supposed to be Printers. Printers is the collection of printers on your system.

hkdani 39 Posting Pro in Training

uhh kk... ill try and see what can i do...

Usually, there's a section in your Sequel Server Menu section that shows you how to set up your passwords. If you'll read the Help Menu for your SQL Server 2000, look for the section that deals with setting up a connection.

Apparently, you haven't done your homework. You need to do some digging.

hkdani 39 Posting Pro in Training

Try messing around with the Data Environment View.

From the View Menu choose Data View Window

Click on the second icon to add a Data Environment. You should then see a
Connection1 in Data Environment View frame.

Right Click on the Connection1 icon and choose the Properties Menu. At this point you should be able to figure out what settings to use if your SQL server is properly set up. If you still have problems, you need to read through the SQL documentation on how to setup your connection on your machine.

You don't need to use a Data Environment. But it's useful to teach you how to properly set up the parameters to use your SQL Server.

hkdani 39 Posting Pro in Training

http://www.connectionstrings.com/sql-server#p6

Probably the SQL OLEDB string is probably what you're looking for.

Get your SQL Server up and running first. Add a reference to the Microsoft ActiveX Recordset 2.x library in your project.

Instantiate your ActiveX Database Objects (ADODB) as follows:

Private rst as ADODB.Recordset
Private cn as ADODB.Connection


Private Sub Form_Load()
set rst = new ADODB.Recordset
set cn = new ADODB.Connection

cn.ConnectionString = ' Your Connection string

rst.open ' your recordset 
End Sub
hkdani 39 Posting Pro in Training

but when the script try to connect IPs which recorded to te excel file telnet do not let this happen

This is the part of the code which is causing the problem, apparently. However, I cannot read your mind. Nor do I have the ability to divine what was written in your script at this part.

You need to provide information that we can use to work with. Provide the part of the script you're using that doesn't work. Otherwise, we're still just shooting in the dark.

hkdani 39 Posting Pro in Training

Need more information to help you out. Exactly what are you trying to do?
How would you do this directly using a telnet prompt?

Give an example of what you need to do. Without the information, It's really like trying to shoot in the dark.

Buy you might try using a shell command.

dim lngReturn as long
lngReturn = shell("telnet.exe 155.23.23.24 other parameters etc, 3")

You should get a return value of the program's (telnet) task ID. Or 0 if the shell
command did not work. The shell expects a string so the string type should not be a
problem. Spaces mark the different parameters telnet expects. The 3 value just signifies a
value for the type of window you want telnet to take. Check the shell command in your
documentation.

hkdani 39 Posting Pro in Training

Hi everybody,

i am trying to get IPs from a switch with vbs through telnet. i am recording that IPs to excel sheet. the problem is when i try to read that IP data vbs copy or paste it as a string. so telnet can not recognize string as a ip adress. please help me about this problem

You need to convert the data back to the data type that telnet requires.
"2" is a string value
CInt("2") is an integer value

Telnet raises an error because it cannot use a string value in that situation.

hkdani 39 Posting Pro in Training

When doing resizing in VB6 you need to be careful to include an On Error
statement. The following example illustrates how to resize a text box to
correspond with the size of the form as it resizes. You need to do similar
coding to deal with height. The principles shown here can be applied to other
controls.

But you need to establish original values and save them for future calculations
within the resize event of the form.

Option Explicit
Private lngOrigTxtWidth As Long
Private lngOrigFormWidth As Long
Private Sub Form_Load()
    lngOrigTxtWidth = Text1.Width
    lngOrigFormWidth = Form1.Width
End Sub

Private Sub Form_Resize()
    On Error GoTo Resize_Error
    Dim lngNewWidth As Long
    ' use ratios to calculate a new value.
    ' lngOrigTxtWidth / lngOrigFormWidth = Unknown / me.ScaleWidth
    ' Unknown = me.scalewidth * (lngOrigTxtWidth/lngOrigFormWidth)
    lngNewWidth = ScaleWidth * (lngOrigTxtWidth / lngOrigFormWidth)
    Text1.Width = lngNewWidth
    Exit Sub
Resize_Error:
    Debug.Print Err.Description
End Sub

Sometimes when resizing you come up with invalid values that don't make sense:
i.e., division by zero, etc.

hkdani 39 Posting Pro in Training

You use the Set Printer = Printer(Index) to set
a particular printer in an application to be used.
You need to do this before setting the other properties.
And, of course, before printing.

You'll need a listbox, and a command button to use this
example.

Private PrinterNames(10) As String
Private prn As Printer
Private intPrinterToUse As Integer

' After Clicking the listbox to select a printer,
' this command will set the printer for the current application.
Private Sub Command1_Click()
    Set Printer = Printer(intPrinterToUse)
End Sub

' This cycles through the list of available printers in the
' Windows Operating system. As it cycles through it saves the
' printer name along with its index. The index will correspond to
' the same index used as the index in the Printers Collection object.
Private Sub Form_Load()
    Set prn = Printer
    Dim i As Integer
    ' Populate an array of Printer Names
    
    For Each prn In Printers
        List1.AddItem CStr(i) & " " & prn.DeviceName
        PrinterNames(i) = i & " " & prn.DeviceName
        i = i + 1
    Next
End Sub

' Click on a printer to save the index for future use.
Private Sub List1_Click()
    intPrinterToUse = List1.ListIndex
End Sub
hkdani 39 Posting Pro in Training

@hkdani, I will try it in a while. Thanks. Its always good to debug.

There is an option in the compile stage of the executable where you can make a debug build of your program. Turn off all the optimizations and check the option to make a debug build.

You can debug the executable file in Visual C++ of Visual Studio. It might be easier to use than Dependency Walker.

hkdani 39 Posting Pro in Training

Well, I would set a break point at the start of the function that opens the URL and use your <F8> function key to step through it until crashes. At this point, you need to develop some debugging skills to find your problem.

But I would guess it crashes somewhere at this point: webbrowser1.navigate "..... " That might not tell you much, but it should give you a good starting point.

Try Dependency Walker. Install it. Read through the manual and get an idea of how it works and then load the program from Dependency Walker. It should show you exactly which control, dll, etc. is the source of the problem.

http://www.dependencywalker.com

Dependency Walker is also very useful for troubleshooting system errors related to loading and executing modules.

hkdani 39 Posting Pro in Training

I run it and it extracts dll(s) to my system32 folder. I'm not sure because it is very fast and I was only able to point out the folder after printing the screen after clicking the .exe file. It unpacked comcat.dll to my system32. I don't know what else it did. I don't see those cab files you mentioned though. My about page and version details remain the same.

That's odd. Maybe you're not using a US English Version of VB6? Your English appears to be very good. I would guess that you're using an English Version of VB6? Could you verify that? If not, it may be that the application only appears to be updating.

I would right click on the file and set its properties to XP SP2 mode first. And then I would right click on the setupsp6 file that you found and run it as Administrator. AndreRet has an excellent post on things you should do when installing vb6 apps on Vista or Windows 7 you should check out. Those files I mentioned should show up I would say. Maybe you have the hidden file options set and can't see them?

I've installed SP6 on Windows 2000, Windows XP64, Window XP, etc. and every time I install it I see the SP6 show up in the splash screen and the About Box. I've never failed to see that message. It may be that the bug you're seeing has already been fixed. But the service …

hkdani 39 Posting Pro in Training

Your first step should be to find the start or the end point.

You need to cycle through the matrix of given points until a start or end point has been found. At that point in your program, you can proceed to the next phase in your search. I presume you will start your search in one of the four corners of the matrix.

You probably should declare a two dimensional array to contain the values of the points on the matrix. I'm also assuming that the state for each point has already been supplied in some manner.

The values for the array declaration will depend on the size of your matrix. int MYPOINTS[100][100] ;

hkdani 39 Posting Pro in Training

You want to write this in C.
That's fine.
Use a while statement.

While (expression) // 
{
      statements ; // statements to test for the state you are seeking

}
hkdani 39 Posting Pro in Training

Ok. You can download the service pack here:
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=7b9ba261-7a9c-43e7-9117-f673077ffb3c&displaylang=en

Sounds like you just extracted the files without installing the service pack. Back then Microsoft did not do everything for you like they do today.

It will ask you to specify a location on you hard drive to extract files: I use "c:\sp6" or something that I can find.

You'll have to find that folder: it's full of cab files, dlls, which will probably help improve the stability of your program.

In particular, there is a mswinsck.cab file and a msinet.cab file that probably contain updates that will help out your situation.

But after finding and running the setupsp6.exe file in this folder, your Visual Basic About form should say something like the following:

Microsoft Visual Basic 6.0 (SP6)
For 32-bit Windows Development

Copyright @ 1987-2000 Microsoft Corp.
.............
.............
Version 9782 VBA: Retail 6.0.9782

Notice the version number and the Visual Basic for Applications version number:

Also the initial splash screen when you start up VB6 now shows a nice big 'SP6' in bold black letters to the right and under the Visual Basic 6.0 title of the splash screen.

If any of what I have just written doesn't look familiar, you probably do not have service pack 6 installed. My version number is 9782 after installing SP6. Your about box should have the "(SP6)" now after Visual Basic 6.0
, i.e. Visual Basic 6.0 (SP6).

hkdani 39 Posting Pro in Training

Can't be an OS problem if the ShellExecute function works properly called from your vb6 program.

The problem is in vb6. Do you have service pack 6 installed? And you can also check to see if you have the latest merge modules installed.

Sometimes VB6 has threading problems. It loses threads. In the middle of a function it will just quit and skip 15 lines of code. Certain controls and processes are notorious for doing this: e.g. Jet database calls, third party ActiveX controls, and even Microsofts' own controls.

Microsoft was pulling their hair out trying to make the internet work with visual studio 6 when it came into full bloom. Why do you think we have .NET?

The key is to get the internet to work on its own thread. If your vb6 app and the control are sharing the same thread, you'll probably have problems. Use ShellExecute or figure out a way to make your own vb6 apartment threaded dll or ocx that you can call that will run in its own thread and memory space.

hkdani 39 Posting Pro in Training

If you are on a wired network, transfer speeds probably are at least 3 megabytes a second, probably faster with the newer 1 GB network cards. I seriously doubt CPU or hardware capability is your problem.

You might check your network wire. It might not be solid core wire. Maybe some of those cheap pre-built wires from Radio Shack, Best Buy, etc.

If your network is using a domain name type server instead of a workgroup type set up, then windows home premium does not support domain name servers. That is a professional business feature for which Microsoft charges extra. It just will not work.

hkdani 39 Posting Pro in Training

Try running this outside the VB6 environment by isolating the web function with a call to the ShellExecute function.
If the problem persists, the problem should stem from the VB6 environment.
Make sure you have service pack 6 installed.

Option Explicit
' Windows Function ShellExecute
' Windows C Language Function, references the shell32 dynamic link library
'
' "HINSTANCE ShellExecute(
'    HWND hwnd,
'    LPCTSTR lpOperation,
'    LPCTSTR lpFile,
'    LPCTSTR lpParameters,
'    LPCTSTR lpDirectory,
'    INT nShowCmd
' );
' Opens or prints a specified file.
' Returns a value greater than 32 if successful, or an error value
' that is less than or equal to 32 otherwise. The following table
' lists the error values. The return value is cast as an HINSTANCE
' for backward compatibility with 16-bit Windows applications." (Visual Studio 6: MSDN)

' -----------------------------------------------------
' Windows Platform Software Development Kit (PSDK) Functions
Private Declare Function ShellExecute Lib "shell32" Alias "ShellExecuteA" (ByVal hWnd As Long, _
    ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, _
    ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

' ------------------------------------------------------
' Windows PSDK Constants
Private Const SW_MAXIMIZE = 3
Private Const SW_NORMAL = 1
Private Const SW_SHOWNORMAL = 1
Private Const SW_SHOWMAXIMIZED = 3
Private Const ERROR_FILE_NOT_FOUND = 2&
Private Const ERROR_PATH_NOT_FOUND = 3&
Private Const SE_ERR_NOASSOC = 31
Private Const SE_ERR_ACCESSDENIED = 5


Private Sub Form_Load()
    On Error GoTo LOAD_ERR
    Dim lngReturn As Long
    lngReturn = ShellExecute(Me.hWnd, "open", "iexplore.exe", "
       
hkdani 39 Posting Pro in Training

Apparently, the datagrid control changes rows on its own when you click on the datagrid or when you are using the ADODC. But you should not
use the click event. Rather, use the RowColChange event and use the bookmark property to set the row.

Private Sub DataGrid1_RowColChange(LastRow as Variant, ByVal LastCol as Integer)
     text1 = DataGrid1.Columns("ProductID").CellValue(DataGrid1.Bookmark)
End Sub

' If you'll do the above, then updating the data should be fairly simple:

Private Sub cmdUpdate_Click()
     DataGrid1.Columns("UnitPrice") = Text1
End Sub
hkdani 39 Posting Pro in Training

You need to write code to move to the next row in the database:

Adodc1.Recordset.MoveNext

or

Adodc1.Recordset.MovePrev

depending on what you're doing.

If you want to get fancy, you can seek a particular row:

Adodc1.Recordset.seek ...
hkdani 39 Posting Pro in Training

"Item cannot be found in the collection corresponding to the requested name or ordinal"

That usually shows up because the field name isn't spelled right or does not exist in the field names of the recordset.

hkdani 39 Posting Pro in Training

Try using something like the following for loading the control without a popup.

It works for password protected ftp sites: e.g. ftp://username:password@ftp.website.com

http://username:password@webaddress

hkdani 39 Posting Pro in Training

Hi:)
How can I scroll the report in runtime by mousewheel. I am using VB6 (SP6) and for reports I am using VB report control.

Which Report Control?

The Data Report Control?

Be specific and use the exact terms given in the VB6 environment.


To scroll a report control in the vb6 environment, you should check to see if the control supports mouse events: e.g. mouse down, mouse move, etc.

That's the easiest way to use the mouse in vb6. However, the data report control does not include mouse movement events. So you'll have to either modify the control by designing your own custom control or monitor the mouse events using the Platform SDK APIs that deal with mouse messages.

hkdani 39 Posting Pro in Training

No easy code exists. The PictureBox does not support a rotate function.
You will have to use some of the Win32 APIs from the Software Development Kit to
deal with rotating a picture.

hkdani 39 Posting Pro in Training

Here's some basic suggestions. You'll have to figure out how to
enter the correct variable values for the text and search strings. And
you'll need to load the Windows Scripting Runtime from the Projects/reference
menu.

Option Explicit
Dim fso As FileSystemObject
Dim strSearch As String
Private Sub cmdFind_Click()
    Dim fil As File, ts As TextStream
    Set fso = New FileSystemObject
    Dim strEnv As String, strLine As String
    Dim blnFound As Boolean
    strEnv = Environ$("APPDATA")
    If fso.FileExists(strEnv & "\Example.pref") Then
        Debug.Print "File Exists"
        Set fil = fso.GetFile(strEnv & "\Example.pref")
        Set ts = fil.OpenAsTextStream(ForReading)
        
        While ts.AtEndOfStream = False
            strLine = ts.ReadLine
            blnFound = SearchString(strLine, "example")
            If blnFound Then
                ' Complete your query
                Exit Sub
            End If
            
        Wend
        
        If Not (blnFound) Then
            MsgBox "String not found", vbOKOnly, "Status"
            Exit Sub
        End If
    Else
        Debug.Print "File does not exist"
    End If
End Sub


Private Function SearchString(StringToSearch As String, Criteria As String) As Boolean
    Dim lngReturn As Long
    lngReturn = InStr(1, StringToSearch, Criteria, vbTextCompare)
    
    If lngReturn > 0 Then
        SearchString = True
    Else
        SearchString = False
    End If
End Function
hkdani 39 Posting Pro in Training

#
' Command object:
#
Dim check As New ADODB.command
#

#
' Create a connection object. and connect:
#
Dim ConDB As ADODB.connection
#
Set ConDB = New ADODB.connection
#
Dim strConn As String
#
strConn = "PROVIDER=SQLOLEDB;"
#
strConn = strConn & "DATA SOURCE=LENOVO-325FBA33\SQLEXPRESS;INITIAL CATALOG=StagingArena;"
#
strConn = strConn & " INTEGRATED SECURITY=sspi;"
#
ConDB.Open strConn
#

#
' Set Parameters for procedure:
#
Set check = New ADODB.command

dim check as ADODB.command
set check = new ADODB.command

Looks like your instantiating the command object twice. You can get by using only your first line: that would be late binding.

Or you can do as shown above. That would be early binding.
It's quicker than late binding and is the preferred way.

As far as your error, you might check on the proper inclusion of special characters in strings. Not sure, but it's possible the '@' sign has to be properly inserted in the code. The @ sign has special meaning in certain database engines.

hkdani 39 Posting Pro in Training

I want to be able to rotate it.

What do you mean rotate? That's kind of vague.

Rotate it like an airplane propeller?

Rotate it like a Marquee on a scoreboard?

Please, clarify. You need to clarify what 'it' is.

I'm guessing you want to rotate the picture and the text as a unit?

Hank

hkdani 39 Posting Pro in Training

IT would help if you would identify on which OS you are trying to delete these 'symlinks.'

Different operating systems on windows have different support for linking files.

And how do you know these are symbolic links?

How are they listed?

hkdani 39 Posting Pro in Training

What is the bug in the code?

#include <winsock.h> ?

Shouldn't you include <winsock.h> in your header?
That's where ntohs is found.

What compiler are you using?
Compiles fine with Borland 5.51 with winsock.h but generates an error when leaving out the winsock header.

Hank

hkdani 39 Posting Pro in Training

wow, good stuff
But, I just want to get the picture. so pretty much I need the page display of that pdf.
Do you what property should I use?
I have tried using .print property but it doesn't work (or maybe I am the one who didn't know how to use it). thanks

Like VB5 said, "Put a control on the form."

Click on the toolbar and add a component: Adobe Acrobat 7.0 Browser Control Type library 1.0

And then you have to set the properties and methods correctly to load a document. You can do this from a menu or in the Load of the form.

With AcroPDF1
         .Container = Frame1  ' or PictureBox1, etc.
         .LoadFile "D:\Documents and Settings\Joe User\My Documents\MyNew.pdf"
         .gotoFirstPage
         .Move 10, 10, Frame1.Width - 10, Frame1.Height - 10
         .setPageMode ("none")
        .Visible = True
         
End With

That should show it. You probably will have to mess with the resize event to resize the frame or the picture box when the form is resized.

hkdani 39 Posting Pro in Training

I'll try ODBC Direct and see where it takes me. Thanks.

Access97 uses Microsoft DAO 3.51 Object Library as opposed to the 3.6 Object library used by AccessOffice 2002

Your problem probably arises from the fact that you have loaded the a DAO Object Library that will not support the format of the data that you are trying to load. Either that or not loading the appropriate provider when using the ADO object library.

So, you probably should avoid using the DAO object libraries and use the ActiveX Data Objects 2.8 library exclusively since they should work with either version of Access97 or Access 2002.

dim rst as adodb.recordset
dim cn as adodb.connection

Private sub form_load()
     set rst = new adodb.recordset
     set cn = new Adodb.Connection

     With cn
          .Provider = "Microsoft.Jet.OLEDB.3.51"
          .open "c:\My Folder\myfile.mdb" 
     End with
      
     rst.Open "MyTableName", cn, adOpenDynamic, adLockOptimistic
End sub()

Notice the Provider property of the ADODB connection.

You'll probably have to have different functions to load the appropriate provider or use parameters in the function to load the appropriate Provider depending on whether it's Access97 or a later version of Access

Private Function Load_Access ( AccessVersion as Integer) as Boolean
     '   Instantiate your recordset and connection here   
      Select CASE AccessVersion
      Case 97 
           cn.Provider = "Microsoft.Jet.OLEDB.3.51"
      Case 2002
           cn.Provider = "Microsoft.Jet.OLEDB.4.0"
      Case Else
      End Select

      ' Load your recordset here
End Function()
hkdani 39 Posting Pro in Training

thanks for the info. Anything will do.
I don't need to do anything with the picture.
I just need to use it in "loadpicture" picture function and display it.
Which way do you thing is the easiest?
thanks a lot, it's relieve to know that it is possible

Graphics formats recognized by Visual Basic include bitmap (.bmp) files, icon (.ico) files, cursor (.cur) files, run-length encoded (.rle) files, metafile (.wmf) files, enhanced metafiles (.emf), GIF (.gif) files, and JPEG (.jpg) files(MSDN).

Looks like you have to convert the pdf file first into a format that's supported by the LoadPicture method , like vb5 said.

So, download a utility like he said and use the one of the Shell functions from VB6 or the Windows API to execute the utility to put the pdf into a jpeg. Then once that's done, you should have a converted jpeg file on your system that you can use in the LoadPicture method.

hkdani 39 Posting Pro in Training

<code>
myIE.document.all("ddModel").Value = "123SV" ' this should set the value to what i'm wanting
</code>

Into what are you writing this code?

Looks like HTML code not Visual Basic for Applications (VBA) code.

And which library from the Tools menu are you referencing to call myIE.document.all("ddModel").Value = "123SV" Could you show how you are creating an instance (instantiating) the document object?

For example: Dim MyIE as new HtmlDocument

hkdani 39 Posting Pro in Training

" language="javascript" id="ddModel"

Shouldn't you be using vbscript to be requesting help on this forum?

And what enviroment or IDE are you using to write your code?
InterDEV 6.0?

I know with InterDEV you can step through the code to debug it to see what's actually happening.

hkdani 39 Posting Pro in Training

I believe the answer to this problem was mentioned in another thread.

With the TurboC++ 3.x compiler you need to enable the Graphics Library in the Options->Linker->Libraries Menu in order for the graphics functions to compile correctly.

The code looks fine. Just lacks the check box in the drop down menu.

Pretty simple really.

hkdani 39 Posting Pro in Training
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>

int main()
{
     int x1, y1, x2, y2 ;
     char String[80] ;
     printf ("Enter Starting X: ") ;
     gets(String) ;
     x1 = atoi(String) ;
     printf("Enter Starting Y: ") ;
     gets(String) ;
     y1 = atoi(String)  ;
/* ......
    */
     rectangle (x1, y1, x2, y2) ;
     return 0 ;
}
/* that's basically it. I downloaded the Turbo C++ 3.0 IDE. Looks like a free download. But it generates an error linking rectangle.  Running on Windows 2000: undefined symbol _rectangle in graphics.cpp (the name of my source file).  But like the previous poster suggested, the example code given in the help file should be your best source of help. Maybe someone with more experience with this compiler could help you get around the error message here in the linking. Found a post. In the IDE you need to make sure the Graphics Libraries is checked from the Menu: Options>Linker>Libraries!*/

That's the general idea. But that should get you started. After checking the Graphics Library in the options menu, the program compiled, linked, and ran and actually drew a rectangle. Pretty cool for an old IDE. Reminds me of that video I saw on YouTube of this guy who hooked up an ancient 300 baud per second analog modem. He put the phone on microphones to receive and transmit the audio. And then he hooked it up to the current world wide web and using a linux box and used lynx to view a …

hkdani 39 Posting Pro in Training

------------------

Windows.. I'm using borland turbo C++.. do u have any idea about this problem.? i'm so desperately need some example of it.. :'(

Using the Free Borland 5.5 command line compiler?

Which version?

Using Borland C++ Builder?