|
1. Sorry, don't know this. Probably som API-stuff
2. Try this:
if App.PrevInstance then
' app already running
endif
Øyvind.
|
|
|
|
|
Not sure if this will help as it is really old but search MSDN Lib for Q72918 in the title.
|
|
|
|
|
I'm attempting to create an Emulator for an Online Game, I was wondering if anyone could offer some helpful advice?
|
|
|
|
|
Don't try to use VB; unless you are looking for a headache. Use C++ instead.
|
|
|
|
|
I know it's a long shot, but does any one know an object \ com object that draws schedual for project's \ other things, like in MS project. I need to create scheduals for many projects and a component like that would be very usable to me.
Rayman
|
|
|
|
|
I've been using the Solutions:Schedule component from DBI-technologies in a big project. Try it out http://www.dbi-tech.com/product_info_prime/solschd.htm
|
|
|
|
|
I am writing an application in VB6 to interface with SQL 6.5 and have a question regarding catching login failure messages. The first thing my application does is prompt the user for his SQL userid and password. I then try to login to SQL Server. If the user entered a wrong password, the Microsoft SQL Server Login failed message is displayed.This message contains too much technical information that will confuse the users. I would like to trap the error and send my own screen with more user friendly information. The exact error message is 'Connection Failed: SQL State: '28000' SQL Server Error 4002.
Public Connection As String
Public DBTemp As Database
Connection = "odbc;logintimeout=30;DSN=Station Train Control;"
Set DBTemp = OpenDatabase("", True, False, Connection)
Please help!
Lillian.
|
|
|
|
|
Why don't you place the code in a Boolean function,
then trap it like followed:
private function connect_to_db(Connection as string) as boolean
on error goto failed_open
set DBTemp = OpenDataBase("",true,false,Connection )'Public
connect_to_db = true
exit function
failed_open:
if err.number = 28000 then msgbox "Wrong Password Or User name, please try again"
connect_to_db=false
exit function
end function
Hoped to have helped you :
Rayman
|
|
|
|
|
Public Connection1 As ADODB.Connection
Public strConnectionString As String
Public strUserWsd As String
Public strUserID As String
Set Connection1 = New ADODB.Connection
Connection1.ConnectionString = strConnectionString
'we already catch the UserID and Pwd info in this stage
strConnectionString = "DSN=Station Train Control;UID=" + strUserID + ";PWD=" + strUserWsd
Connection1.Open strConnectionString, strUserID, strUserWsd
'in this stage of the program : open Connection1 establish a principal connection
'later in the program
'call flexGrid
'the control "MSRDC1" for the FlexGrid which manupulate with the information for the Grid
frmDepArrival.MSRDC1.Connect = strConnectionString
frmDepArrival.MSRDC1.UserName = strUserID
frmDepArrival.MSRDC1.Password = strUserWsd
'the program keeping the same connection....everything it's still OK
frmDepArrival.MSRDC1.SQL = " select 'Train #'=trn_no ,'Track #'=trk_no,'Schedule'=convert(char(5),sch_dep_tm,14),'Actual'=convert(char(5),act_dep_tm,14) ,'Delay(min)'=DateDiff(mi,sch_dep_tm ,act_dep_tm ) from actdep where trn_prcs_dt = '10-04-2001 12:00PM' and in_stn_ind ='N' order by sch_dep_tm asc "
frmDepArrival.MSRDC2.Connect = strConnectionString
frmDepArrival.MSRDC2.UserName = strUserID
frmDepArrival.MSRDC2.Password = strUserWsd
'the program keeping the same connection....everything it's still OK
frmDepArrival.MSRDC2.SQL =select 'Train #'=trn_no ,'Track #'=trk_no ,'Schedule'=convert(char(5),sch_arr_tm,14) ,'Actual'=convert(char(5),act_arr_tm,14) ,'Delay(min)'=DateDiff(mi,sch_arr_tm,act_arr_tm) from actarr where trn_prcs_dt = '10-04-2001 12:00PM' and in_stn_ind ='N' order by sch_arr_tm asc
'the program keeping the same connection....everything it's still OK
'in this stage the program opening new connection on Refresh method,Why?
frmDepArrival.MSRDC1.Refresh
'in this stage the program opening new connection on Refresh method,Why?
frmDepArrival.MSRDC2.Refresh
The question :
How I can keep the "Microsoft SQL Server 6.5 " from opening the new connection on Refresh
method the FlexGrid's and using the old "one and only" connection in the program???
Lillian
|
|
|
|
|
Hi Gurus,
I have a program which needs to sign on MAPI to send email. This program is scheduled by Task Scheduler run under an account that has an existing valid MAPI profile. Unluckily, when the program is evoked, it cannot log on to the MAPI system and expreriences "Not supported" error message. I suppose this has something to do with security context with Scheduler. This error is weird, and I do not know what to do! You guys please help me! My email ID is cuongpl@hotmail.com.
Thanks,
|
|
|
|
|
Hi,
I'm developing an application and I would like it to utilise a WebBrowser control. I would like to control the scroll bars and border styles programatically, only the Microsoft control does not appear to allow access to these properties.
Are there any alternative controls out there?
Matthew
|
|
|
|
|
I have a question in mshflexgrid.
I want to set the first two rows and all the cols in these two rows mergable, and other cols can not.
Does somebody know how to do with it?
Thanks very much!
|
|
|
|
|
How to open a text file using a thread in VB?
|
|
|
|
|
Wait for Visual Basic .NET
|
|
|
|
|
Is this true? Could you send me a pointer to MS's marketing hype on Multithreading in VB?
Thanks,
Kevin
|
|
|
|
|
Visit Microsoft's .NET sites, start at: http://www.microsoft.com/net/ and http://msdn.microsoft.com/vstudio/nextgen/default.asp
Multithreading is a design feature of the CLR, the Common Language Runtime, which is an integral part of .NET. All managed .NET languages are using the CLR, including Visual Basic, which is the main reason why its syntax had to change quite a bit from VB6 (to the better though).
|
|
|
|
|
If it's a XML you can use DomDocument.Load and set DOMDocument.async = true
Furor fit laesa saepius patientia
|
|
|
|
|
Due to a series of mishaps, I had to reinstall MS Developer Studio 6.0 several times. Everything seems to work again but I have noticed that the menu in VB and Outlook 2000 are a different font than they used to be, bold at least if not a new font. I went in to the display properties dialog and checked the menu setting under the appearances tab and it looked ok. VC++ menu looks fine (File, Edit, etc.). Just seems to be affecting VB and Outlook. Any ideas?
Thanks
David
|
|
|
|
|
How do you access command line parameters in a visual basic program?
|
|
|
|
|
Just in case anyone else is interested there is an article on CodeGuru that documents the extraction of multiple command line parameters.
http://www.codeguru.com/vb/articles/1755.shtml
|
|
|
|
|
Is there anyway to have a menu in an ActiveX control, to be used in an asp?
Thanks
Aaron
|
|
|
|
|
Anyone know how to convert the vba function Now - which returns the date and time as follows -
23/09/01 08:27
into a straight foward number without all the / and : bits?
|
|
|
|
|
Use the VB function FormatDateTime(...)
|
|
|
|
|
I wonder if anyone can help me? I have a small piece of vba in excel that works fine except for one thing. It saves a spreadsheet in as particular directory with a specified name but if it encounters a file of the same name already there and you click no to the save it then dies with error 1004. Can anyone assist?
Here is the code:
Private Sub CommandButton3_Click()
siv = ActiveSheet.Cells(6, 2).Value
'ActiveWorkbook.SaveAs Filename:="C:\My Documents\" & siv & ".xls", FileFormat:=xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, CreateBackup:=False
On Error Resume Next
ActiveWorkbook.Close
End Sub
|
|
|
|
|
What on earth is error 1004 is a window error code?
1004 = Invalid flags. as an internal Windows error code try using the default params?
|
|
|
|