Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic

Msdaora.1 Working But OraOLEDB.Oracle Not Working

I'm connecting to Oracle server with this code:

Dim db As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim str As String

str = "Provider=MSDAORA.1;User ID=*****;Data Source=***;"
db.CursorLocation = adUseClient
db.Open str

it's successfully connected to database... but to pass parameter to a stored procedure with ref cursor I need to use oraOLEDB.Oracle provider. when I'm typing :

str = "Provider=oraOLEDB.Oracle;User ID=*****;Data Source=***;PLSQLRSet=True;"

It's giving me an automation error..
Provider cannot be found. It may not be properly installed. error no. 3706

I don't know what to do.. I don't know why is that error. Could anybdoy Please help me how could i install oraOLEDB.Oracle provider.


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
I want to use the provider insted msdaora.
where can i get the detail example of the same?
what need to be installed on the machine to use this provider?
my machine is windows 2000 with oracle 9i as backend

is it feasible to use insted of msdaora?
plese give me comparison between both of this    

Error In Connecting To Oracle Thru MSDAORA

I m passing my userid and pswd to an asp page,and in the asp page i try to connect to Oracle using this code:

Call objDB.Open("Provider=MSDAORA;Data Source=SBLT7;struser;sEPassword")

But,i get this error:
Error:ORA-01017: invalid username/password; logon denied
Source:Microsoft OLE DB Provider for Oracle
Error no.:-2147217843

Can somebody pls help me resolve this problem!

Add New Not Working In Oracle 8i
I have tried to connect to oracle on my comp using vb's ado connection object.
Im able to browse through the records usiing the recordset object however Im unable to add any new records using addnew function of the recordset object.
It is working fine with mssql server.

The oracale database and vb are on the same machine

Any solns?

Visual Basic To Oracle Not Working Properly
Could anyone explain to me why the code below does not work?
When I step through it using the F8 key everything appears to work just fine. I know my connection to Oracle works, but the "rs.Open strCheck,...." statement never returns any records. It should actually be returning thousands of records.

NOTE: I took the names of our database and it's tables out of the code.


Private Sub Form_Load()
Dim ORAcon As New ADODB.Connection
Dim rs As New ADODB.Recordset
Set rs = New Recordset
Dim intCount As Integer

ORAcon.Open "Provider=MSDAORA;User ID =; Password =; Data Source = NameofourDatabase;"

strCheck = "Select * From ourtable"

Debug.Print strCheck
rs.Open strCheck, ORAcon, adOpenDynamic, adLockPessimistic

For intCount = 1 To rs.RecordCount
lstDoctors.AddItem rs.Fields!DOC_NAME, intCount
End Sub

Oracle Connection Stops Working W/o Change To Form?
The strangest thing happened to me and a client. Applications that have worked for ages just stopped working. They are getting a TNSNAMES error (service name not resolved) on a database that I connected on a daily bases via TOAD (among other methods). I know that my tnsnames.ora is fine...and the TNSPING works fine (comes back with an OK). Could MS made a change that would effect my connection? Do I need to re-write my app in VB.NET for some reason?
My project has the MS ActiveX Objects (tried 2.6, 2.7, 2.8) as well as the Oracle InProc Server

Here is the simple Logon form code:

VB Code:
Option ExplicitPublic OraSession As OraSessionPublic connect As String Public Sub cmd_Click(Index As Integer) If Index = 0 Then        connect = txtField(0) + "/" + txtField(1)        sUserID = txtField(0)        sDatabase = txtField(2)        GoTo ErrorHandlerElse    If Index = 1 Then        End    End IfEnd IfErrorHandler:                        If OraSession.LastServerErr = 0 Then            If Err = 0 Then             '                'MsgBox ("connected.") ' as " & Connect)                Set OraSession = CreateObject("OracleInProcServer.xorasession")                Set OraDatabase = OraSession.OpenDatabase(txtField(2), connect, 0&)                sDatabase = txtField(2)                Me.Hide                Unload Me                Reset_Menu                frmMain.Show            Else                MsgBox ("VB=" & Err & " " & Error)            End If        Else            MsgBox (OraSession.LastServerErrText)        End If        End Sub Public Sub Form_Load()    Set OraSession = CreateObject("Oracleinprocserver.xorasession")    cmd(0).Enabled = False    'txtField(2).text = "PROD"End Sub Private Sub Form_Unload(Cancel As Integer)    frmMain.ShowEnd Sub Public Sub lblField_Click(Index As Integer)    Select Case Index        Case 0            If (txtField(0) <> "") And (txtField(1) <> "") And (txtField(2) <> "") Then                cmd(0).Enabled = True                cmd(2).Enabled = True            End If        Case 1        Case 2    End SelectEnd Sub Public Sub txtField_GotFocus(Index As Integer)    txtField(Index).SelStart = 0    txtField(Index).SelLength = Len(txtField(Index))End Sub Private Sub txtField_LostFocus(Index As Integer)    If Len(Trim(txtField(0))) > 0 And Len(Trim(txtField(1))) > 0 And Len(Trim(txtField(2))) > 0 Then        cmd_Click (0)    End IfEnd Sub Public Sub txtField_Validate(Index As Integer, Cancel As Boolean)    If (txtField(0) <> "") And (txtField(1) <> "") And (txtField(2) <> "") Then        cmd(0).Enabled = True    End IfEnd Sub

any suggestions? I am stumped. There is only one TNSNAMES file on my system. Is there anywhere where VB looks for Oracle information that might be messed up?



Wave Files And Vista. Some Working And Some Not Working. Strange.
Hello everybody,

I have an application with embedded in the ressource file wave files. I use PlaySound to play them. This works perfectly up to Windows Xp.

Recently I have a friend testing the application on Vista. Certain files are not playing, and others are.

Any ideas why some would play and some wouldn't? It seems very strange.

Here is the code. It works for some wave files and not others

VB Code:

Application Working On Office 97 But Not Working On Office2000 !
Hi everybody,

I use an application based on Excel working initially on office 97 developped by a workmate few years ago and now not working on office 2000. Here is the error raised and the part of code responsible for that :


Toolbars.Add Name:="Tableau de Bord"
Toolbars("Tableau de Bord").Visible = True
With Application
.ShowToolTips = True
.LargeButtons = False
.ColorButtons = True
End With
Toolbars("Tableau de Bord").ToolbarButtons.Add Button:=126, before:=1
Toolbars("Tableau de Bord").ToolbarButtons(1).OnAction = "AppelProcedure"

(here is the mistake !!!!) Toolbars("Tableau de Bord").ToolbarButtons.Add Button:=243, before:=2
Toolbars("Tableau de Bord").ToolbarButtons(2).OnAction = "AppelProcedure"

Toolbars("Tableau de Bord").ToolbarButtons.Add Button:=42, before:=3
Toolbars("Tableau de Bord").ToolbarButtons(3).OnAction = "AppelProcedure"
Toolbars("Tableau de Bord").Width = 1527

If someone has an idea ?

Thank you,by advance....

Program Was Working, Now Not Working Runtime Erros
I have a program that searches through a recordset for indexes to lines in an order.

The program worked fine until the owner re-indexed or rebuilt all the indexes. Basically all the pointers changed for these lines, and now my program is freakin out and saying it cant find data.

Heres the code that previously worked, and STILL works on some orders.
Private Sub Command1_Click()

Set rstMyrecset = Nothing
Set Mas90 = Nothing

Do Until strNextline = 0

If Ordernumber <> strSalesorder Then
MsgBox Err.Source & "The order number has changed." & _
"This order is crosslinked." & Err.Description, , "Error"
GoTo error:
End If

cmdMyrecset.CommandText = "SELECT LineIndex, LinkToNextLine," & _
" SalesOrderNumber, LinkToPrevLine FROM SO2_SOEntryDetailLine WHERE" & _
"(LineIndex LIKE '%" & strNextline & "')"
Set rstMyrecset = cmdMyrecset.Execute

strLineindex = rstMyrecset.Fields.Item("LineIndex").Value
strPrevline = rstMyrecset.Fields.Item("LinkToPrevLine").Value
strNextline = rstMyrecset.Fields.Item("LinkToNextLine").Value
strSalesorder = rstMyrecset.Fields.Item("SalesOrderNumber").Value

txtLineindex.Text = strLineindex
txtPrevline.Text = strPrevline
txtNextline.Text = strNextline
txtOrdernumber.Text = strSalesorder


'Sleep 1000

'Open "c:windowsdesktopmylog.txt" For Append As #1
'Print #1, "Previous Line "; strPrevline, "Next Line "; strNextline, "Line Index "; strLineindex
'Close #1

MsgBox "The order started at 00 and ended in 00, and the order number did " & _
"not change. Pre-checking can be notified this order is OK."

txtLineindex.Text = 0
txtPrevline.Text = 0
txtNextline.Text = 0
txtOrdernumber.Text = ""
txt02pointer.Text = 0

End Sub

I believe the offending code is the SELECT statement. The select statement gets the lines, and checks the order, to make sure no lines are crosslinked into another order. On some orders, it works fine, but others, where the lines are low numbers such as 1, 2, or 3, the program bombs, with a FILE i/o error: data not found.

Set Focus Working On Debug And Not Working On Execute In Vb 6.0
my project includes a grid and combo box and 2 to 3 text boxes.
in that am using set focus method
it is working in debug mode but not in execution mode...
please do the need full
thanking you in advance

Working In Excel While VB Is Working -- RESOLVED

I have an application which creates a large Spreadsheet, it takes about 20 minutes all in.
This is not the problem.
The problem is while the Ssheet is being created the user cannot work on the
N other spreadsheets they have on the go.
I have used .visible = false, but to no avail.

Help, how do I keep the application from being shown/messed by a hyperactive user while it is being created.



Component Not Working In Windows 2003 Server But Working In Windows 2000 Server

I have a VB upload component which woeks weel with the Windows 2000 server but when i have the same component installed in the Windows 2003 server it is not working. It is displaying the following error. error '800706be' . Searching the microsoft support site i cannot get any relevant information. If anyone has solution for this.



I am using OraOLEDB.Oracle provider for connecting to Oracle. I dont want to install Oracle client on my client machine. I just want to have ORAOLEDB provider on client side. I have installed my application on client pc and But it is giving me an error Provider not installed properly.

Please provide me guidelines to install Oracle OLE DB provider.

Mdac, Ado, Msdaora

sorry for my ignorance, but I've been given an existing project which apparently uses ADO although MDAC 2.7 is installed (not sure what the difference is).

The provider option in the connection string has been set to MSDAORA. I can't seem to find any documentation which tells me what the options are for the provider i.e. what do I change it to to use ADO / MDAC / ODBC etc.

Can anybody quickly explain it or point me to somewhere that does?

Thanks in advance

ORA-12154 Error. Problem Using MSDAORA
I am using the following code, but it gives error on machines that dont have oracle client installed (ORA-12154 TNS:Could not resolve service name).

Is there a way to connect to oralce thro' VB without installing client by using some other driver. We have about 10,000 users of this program and its not possible to install client on every machine.


Dim ProdConnectString as String
Dim conn As New ADODB.Connection

ProdConnectString = "provider=msdaora.1;user id=xyz;password=abc;data source = testsource;option=1+2+8+32+2048+16384"
conn.ConnectionString = ProdConnectString
conn.CursorLocation = adUseClient

Thanks a lot.


Gif No Working?
a beginner want to ask a simple question, how can i use gif in my vb windows? i know gif is not the defaulf kind to be recognised by VB6, is there any easy way which enables me to use it now?

Gif's Not Working
When I insert a gif into an image or picture box then run the program, the gif doesn't work. I looked in the properties window and it says that the gif is a bitmap. I loaded a jpg later and it still said it was bitmap. How can I fix it? I'm running Visual Basic 6.0 Learning Edition. PLEASE HELP!!!

Working With MSN
I am looking for any code/tutorials or anything at all Visual Basic which allwos me to send messages, change picture etc. Everything is appreciated

How To Get ICQ Working In My App?

Ive been searching for a while now and have found no way to to connect to the icq-service. I dont want to do anything fancy, just connect/disconnect, get online-user-list, and send and receive simple textmessages.

Ive downloaded the icqapi, and hav lots of source that should work with it (even found some here) but nothing worked.

Is there any other way I could do it.
Somebody know a working control that I could use?

I would appreciate any advice you might have

Not Working
i am tring to use this to email a person and no errors come up but the email never gets out, i checked my outlook and sent a email with it and it worked fine.

MAPIMessages1.SessionID = MAPISession1.SessionID
MAPIMessages1.RecipAddress = ""
MAPIMessages1.RecipDisplayName = "james"
MAPIMessages1.MsgSubject = ""
smessage = "Test body message"
MAPIMessages1.MsgNoteText = smessage
MAPIMessages1.Send False


Why Isn't It Working?
hey pals!
when my friend tried to connect to my server he didn't succeed to establish a connection.
does anybody know why it does so?
i am using WinXP and have ADSL and LAN on my computer.
the source code :


Private Sub Form_Load()
Winsock1.LocalPort = 1221
End Sub

Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
Winsock1.Accept requestID
End Sub


Private Sub Command1_Click()
Winsock1.RemoteHost = Text1.Text
Winsock1.RemotePort = Text2.Text
End Sub

Private Sub Winsock1_Connect()
MsgBox "Connected!!!"
End Sub

Private Sub Winsock1_Error(ByVal Number As Integer,
Description As String, ByVal Scode As Long,
ByVal Source As String,
ByVal HelpFile As String,
ByVal HelpContext As Long, CancelDisplay As Boolean)
MsgBox "Error: couldn't connect!"
End Sub

Not Working?
i have narrowed down the problem in my code to this one section


ddsd4.lWidth = 384
ddsd4.lHeight = 32
Set Tilesurf = dd.CreateSurfaceFromFile(App.Path & " extures" & Tileset, ddsd4)
now the only thing that messes up is the last line and i cant figure out why, thank you for any help u can offer.

Working With Ie

I need to open a new IE go to this site ://
and copy the currency table to a new worksheet in the work book that i run the sub from.

So far all I can do Is open IE and get it to the site. I have no idea how to get the data into the workbook.

Help please!!!!!!!!

Not Working With 98
Hi all,

I am totally new to vb. Now making small applications to learn with. All going pretty good with books etc. I just have a small question, if I make an executable file, it does not run under Windows 98 saying that some dll file is missing. I was thinking that a stand alone exe file won't requires something to get installed on the target system. So how can I make the file compatible with other OS. and I made a small app that reads from a text file and displays the lines in a text box. works fine on the system where I wrote it, but if I copy it to another XP system, it says ISAMS not found, I know for that I need drivers but is there any way that I can compile the application so that it takes all what it needs along with it and get no problems if executed at another system.

All help would be greatly appreciated


Why Is It Not Working.....?
Hey everyone. I was here recently talking about how in my programmign class in high schol we were giving a visual basic project to do yet have not actually read too much on visual basic and left to "learn it on our own" and present the project later. Well, I actually got some code up but don't understand why it is not working

The problem was:

Two numbers are said to be 'amicable' if they are different and the sum of the divisors of each number (including 1 but excluding the number itself) equals the other number.
For example: 2620 is divisible by 1, 2, 4, 5, 10, 20, 131, 262, 524, 655 and 1310; these add up to 2924. 2924 is divisible by 1, 2, 4, 17, 34, 43, 68, 86, 172, 731 and 1462; these add up to 2620. Therefore 2620 and 2924 are amicable.

Write a program which inputs two numbers (which will be less than 10,000) and then prints "Amicable" if they are amicable, or "Not amicable".

This is my code:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim factor1 As Integer
factor1 = Val(inputa.Text)
Dim totalfactora As Integer

totalfactora = 0
Dim counter As Integer
counter = factor1 - 1
Do While counter > 0
If counter Mod factor1 = 0 Then
totalfactora = totalfactora + counter
End If
counter = counter - 1

Dim factor2 As Integer
factor2 = Val(inputb.Text)
Dim totalfactorb As Integer
totalfactorb = 0
Dim counter2 As Integer
counter2 = factor2 - 1
Do While counter2 > 0
If counter2 Mod factor2 = 0 Then
totalfactorb = totalfactorb + counter2

End If
counter2 = counter2 - 1

If totalfactora = totalfactorb Then
answer.Text = "they are amicable"
End If
End Sub

Every aspect of the code works individually so I assume its my loop. Is it worded wrong or anything? Ok let me explain the variables:

factor1 is an integer that takes the number from the text(had to use the VAl function like somehow said earlier). totalfactora should be the sum of all of the factors of the factor1 number. Currently its at 0. Then the counter variable will be subtracted 1 each so every number except itself is checked as a factor.

I worded the Do while loop so it would continue runnign as long as counter would stay above 1. Then inserted an if statment to check if the current counter number was a factor and if so, then it would be added to the totalfactors. if not, it wouldn't do anything. At the end of the loop, counter is subtracted 1 and then the process is repeated. Theoretically, I believe it should work heh, but when I tried the loop totalfactora stays 0. Basically the code after it with totalfactorb, coutner2, is just a mirror.

Hope you got what I was trying to say heh. Appreciate any help


I Just Don't See Why This Isn't Working...
Ok, this is for my gr. 10 computer science class. It's a lot simpler than a lot of the stuff I've seen around here (kind of intimidated), but hey, I have to start somewhere right?

Anyways, this is my problem. I'm making an application that's supposed to take popcorn orders. It has check boxes for different flavours. They work when I click it (it adds the extra price to the total "flavours" price), but then when I uncheck the box, it doesn't subtract the price again. Any help?

Private Sub chkButter_Click()
'Add flavours price
If chkButter.Value = vbChecked Then
flavours = flavours + butter
flavours = flavours - butter
End If

'Display total
total = total + flavours

lblTotal.Caption = total

End Sub

Why Is This Not Working :/
Can anyone tell me how i can get this to work?

What im trying to do is this ordering thing for a hotel (its homework )
Here is my layout.

Now what i want it to do is add the caption of the checkbox's and option buttons to the text box when the boxes are checked. but for some reason its not letting me do it :/ i click the box and nothing happens.

This is the code,


Private Sub chk_sky_Click()
If chk_sky.Value = True Then
txt_bill.Text = chk_sky.Caption
End if
End Sub

.next Not Working
ive used it before and its worked but for some reason im having problems with it now.

dim curcell as range
set curcell =

should set curcell to the cell one column left of curcell. right?

well im just getting the original curcell

please help

TLI Not Working
Can anyone tell me why this code isn't working in compiled mode?

Dim TLIApp As New TLIApplication

Public Sub EnumMethods(ListBox As ListBox, lpObject As Object)

Dim ClassInfo As Object, Tell As Long, InvKind As Long

' Get interface information about the object
Set ClassInfo = TLIApp.InterfaceInfoFromObject(lpObject)

' Clear all data

For Tell = 1 To ClassInfo.Members.Count

InvKind = ClassInfo.Members(Tell).InvokeKind

ListBox.AddItem ClassInfo.Members(Tell).Name
End If


End Sub

Private Sub Form_Load()

EnumMethods lstMethods, Me

End Sub
I've added "TypeLib Information" from references, but I still get error 445 when I have compiled it. Some suggestions how I can fix it

.exe Not Working
I made a game, and I went to make it into a .exe file and when I went to run it the dos screen appears then just disappears...anyone know why this is happening or how we can fix it???

Working Out A Sum
I was wondering if i had a textbox with a sum it and i wanted to work out the answer and display it in another text box how would i do it??

Help, Not Working!!
Hello, i have a form with among other things a tabstrip. The tab strip has 3 tabs. The first tab is labeled NOTES. It has a text box below i want to use for a todo/reminder type thing. I want this to be the default tab and text when everything loads up, so i want the todo there everytime you start up. The 2nd tab is called JEFF. It has a label with it that i want to show up when i click on 2nd tab. Same with the third tab. All three, 1 text box, 2 labels are all on top of each other, i want to show the cooresponding one with each click of the tabs. For some reason i just cannot get this right. Below is copy of my code. Im a newb so be patient with my setup please. The basics are here but ive kinda destroyed some code messing with it. I tried a few differnt things including using a select case routine but nothing. Thanks alot up front for any advise.

(at the bottom)

Private Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
Private Declare Function GetMenuItemCount Lib "user32" (ByVal hMenu As Long) As Long
Private Declare Function DrawMenuBar Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Const MF_BYPOSITION = &H400&
Const MF_REMOVE = &H1000&

Private Sub cmdexit_Click()
End Sub

Private Sub Form_Load()
Dim hSysMenu As Long, nCnt As Long
' Get handle to our form's system menu
' (Restore, Maximize, Move, close etc.)
hSysMenu = GetSystemMenu(Me.hwnd, False)

If hSysMenu Then
' Get System menu's menu count
nCnt = GetMenuItemCount(hSysMenu)
If nCnt Then
' Menu count is based on 0 (0, 1, 2, 3...)
RemoveMenu hSysMenu, nCnt - 1, MF_BYPOSITION Or MF_REMOVE
RemoveMenu hSysMenu, nCnt - 2, MF_BYPOSITION Or MF_REMOVE ' Remove the seperator
DrawMenuBar Me.hwnd
' Force caption bar's refresh. Disabling X button

End If
End If
End Sub

Private Sub cmdINTERNET_Click()
Shell ("c:/program files/myie2/myie.exe")

End Sub

Private Sub cmdMUSIC_Click()
End Sub

Private Sub cmdPICTURES_Click()
End Sub

Private Sub cmdUTILITIES_Click()
End Sub

Private Sub tabtodo_Click()


Case tabtodo.Tabs(1).Selected = True

Case tabtodo.Tabs(2).Selected = True
TextNOTES.Visible = False
LblJS.Visible = True
CmdCHOICE1.Enabled = True
CmdCHOICE1.Visible = True
CmdCHOICE2.Enabled = True
CmdCHOICE1.Visible = True

Case tabtodo.Tabs(3).Selected = True
CmdCHOICE1.Enabled = True
CmdCHOICE1.Visible = True

End Select

End Sub

Private Sub Timer1_Timer()
frmdesktop.Caption = Format(" The Time:" & " " & Time, "h:nn:ss am/pm") & " " & "The Date:" & " " & Format(Date, "m/d/yyyy")

End Sub

EOF Not Working?!!
Can somebody please tell me what I'm doing wrong here?
I'm still getting "Run-time error '62': Input past end of file" but I dont see what's wrong.

Thanks very much.

Public Function EOF(ByVal FileNumber As Integer) As Boolean
End Function
Private Sub Command1_Click()

Dim FileName As String
Dim X As Integer

FileName = "C:A.CGF"

Open FileName For Input As #1
Do While Not EOF(1)
Input #1, X
Debug.Print X

Close #1
End Sub

SQL Not Working With Win 95/98
I have the following in my program:

Set myDB = OpenDataBase (myDB)
Project Like '*" & txtProject & "*'"
Set rscd = mydb.Openrecordset(mySQL)

mySQL = "AddDate LIKE '*" & Format$ListAddDates.Text,
"m/d/yyyy") & "*'"
rscd.FindFirst mySQL
If rscd.NoMatch = true then exit sub

Then I go into adding text into a form

Text1.text = rscd.fields("FirstName")

It works when I test it on XP and ME but when I test it on 95/98 it throws me out at the EXIT SUB.

Is there another way to say the same thing so it will work? I need to narrow the fields down twice. When I only need one field - it works fine even on 95/98.?? Any ideas?

Why Is It Not Working?
Hi there.

I cannot get this code to work, please help:

Dim x As Currency
Dim working As Currency
Dim dollarrate As Currency
Dim yenrate As Currency
Dim eurosrate As Currency
Dim commission As Currency
Dim total As Currency

'!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!DOLLARS!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!
'!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!DOLLARS!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!

If txtfirst.Text = "" Or txtlast.Text = "" Then
MsgBox "You have not entered your name"
End If

If mnuCurrencyDollars.Checked = True Then

mnuTransactionBuying.Checked = True
txttransaction.Text = "Buy"
fratransaction.Enabled = True
txtcurrency.Text = "Dollars"
lblenter.Caption = "Enter the amount of " & txtcurrency + " to " & txttransaction
If txtreceipt.Text = "" Then
MsgBox "Please enter the amount of " & txtcurrency + " to " & txttransaction
mnuTransactionBuying.Checked = False
dollarrate = 1.3753
working = txtreceipt.Text / dollarrate
txtst.Text = "" & Math.Round(CCur(working), 2)
commission = 2 / 100 * txtst.Text + txtst.Text
total = commission
txttotal.Text = "" & Math.Round(CCur(total), 2)
End If

End If

If we take of the mnucurrencydollars.checked = true statement then everything works fine.

Currently, with this code, it is not doing anything at all.

Please help.

This part of the Sub will have 2 more "procedures" like this, but the currency's will be for Yen and Euros.

Please help.


Working Out Age
i got a text box that get a date of birth put in it, what do i need to write so that the age is worked out,

Sub Not Working Right
i'm calling a sub from the Form_Load procedure, and the sub will begin to execute (Like 1 or 2 lines) and exit to the calling statement!! need help

Why This Not Working ?
Dear all
I am using a Crystal Report Formula name "@ReportDate" having this text Date(2001,07,01), and passing the correct date from the vb program to this formula as follows:
ReportFile.FormulaFields(3).Text = "Date(2001,06,01)"
When I run the report the formula takes the value stored in the report formula and what I am passing to the report formula has no effect.

Any idea how to solve this, or am I missing something ??

Many thanks in advance

TCP/IP Not Working?
Okay I have a client and a server.. how do I get them to communicate?

I can work on datahandling once I make a connection but I can't get them to connect. I have found several TCP/IP examples on the internet but no matter what I do mine won't work like them.

I found a tic tac game on the internet and I played it on my Lan to test. Then I tried to play a chess game on the netwrok and it won't work because it says "Address is not valid from local machine." So it seems that some TCP/IP apps are made for a lan while others are made for open internet.

Can anyone point me to a TCP/IP resource for this. I need my connection to be open internet but also be able to test it on my Lan...

Just so you know my setup, I have 3 computers on a router sharing the same IP. I thought this would be a problem (and it is), but how can this tic tac toe game work fine?

Still Not Working
Dim cust As CustRec
Dim hire As HireRec
Dim vidarray(3) As Integer
Dim i As Integer, j As Integer
Private Sub cmbSelect_Click()
Open "C:MyWorkVB6AssesmentCustomer.txt" For Input As #1
Do While Not EOF(1)
Input #1, cust.ID
Input #1, cust.sname
Input #1, cust.fname
Input #1, cust.add1
Input #1, cust.Add2
Input #1, cust.Town
Input #1,
Input #1, cust.Phone
Input #1, cust.hire

If cust.ID = cmbSelect.Text Then
'displays the selected customer

lblID.Caption = cust.ID
lblSname.Caption = cust.sname
lblFname.Caption = cust.fname
lblAdd1.Caption = cust.add1
lblAdd2.Caption = cust.Add2
lblTown.Caption = cust.Town
lblPost.Caption =
lblPhone.Caption = cust.Phone
lblHire.Caption = cust.hire

End If
Close #1

Open "C:MyWorkVB6Assesmenthire.txt" For Input As #1
Do While Not EOF(1)
Input #1,
Input #1, hire.cust_ID
Input #1, hire.video_ID
Input #1,
Input #1, hire.copy

If hire.cust_ID = lblID.Caption Then
vidarray(j) = hire.video_ID
End If
j = j + 1
Close #1

For i = 0 To j
lstVids.AddItem vidarray(j)
End Sub

I still can not get the video ID displayed in the list box, it should go through all the hire records and if it comes accross a customer ID that is the same as the one selected in the combo box it will take the Video_ID and place it into an array. Once it has been trough them all it will display the array in the listbox. I'm not sure what is wrong with the code, adding to the array or displaying the array.

Any ideas?

Thanks Gaza

VB6 Not Working
The other day when I started my computer it said that the registry files had screwed up so it had reverted to a recent backup of them, since then I noticed that whenever I try to view a form in the visual basic project whilt editing it it generates an error and immeditaly closes, I can easily view the code but the second whihc I switch view it crashes. Since then I have tries installing, reinstalling it, installing it again, cleaning out registry of all visual basic traces and installing it again but still to no prevail. I have resorted to permananetly removing my vb6 application permanently. What is the problem with it???

Do While Not Working...
hi please check my code:

the do while isnt working...

i wanted to compare text1 and text2 with the field in my database (fld_start, and fld_end)

if the criteria in my search is satisfied..

my problem is, if the criteria is satisfied, text1 and text2 is compared only with the first record...

did i placed the do while in the right place?... thanks...


Dim start, fend, text, Txt As String

Adodc1.Recordset.Find "fld_room = '" + room + "'"
Adodc1.Recordset.Find " fld_day = '" + day + "'"

If Adodc1.Recordset.EOF Then

With Adodc1.Recordset
.Fields!fld_start = Text1
.Fields!fld_end = Text2
.Fields!fld_room = room
.Fields!fld_day = day
End With

MsgBox ("New Schedule Saved!")


Do While Not Adodc1.Recordset.EOF

start = FormatDateTime(Adodc1.Recordset.Fields!fld_start, vbShortTime)
fend = FormatDateTime(Adodc1.Recordset.Fields!fld_end, vbShortTime)

text = FormatDateTime(Text1.text, vbShortTime)
Txt = FormatDateTime(Text2.text, vbShortTime)

'If text > start And Text2 > fend Then
'MsgBox (" Conflict")

If text > start And Text2 < fend Then
MsgBox ("conflict")

ElseIf text < start And Text2 > start Then

ElseIf text = start And Text2 = fend Then
MsgBox ("CoNfLiCt")


With Adodc1.Recordset
.Fields!fld_start = Text1
.Fields!fld_end = Text2
.Fields!fld_room = room
.Fields!fld_day = day
End With

MsgBox ("New Schedule Saved!")

End If

End If


End Sub

Help! Exe Ist Not Working

I've a strange problem: I've written a little system monitor where I can check the status of prozesses running on a remote computer. As long as I run it within "Visual Studio", everything works fine. When I compile the source to a exe and run that program, suddenly parts are no longer working. I need to make a connection to the romote pc by using the "OpenSCManager" API and exactly that function is no longer working:


Any idea what is going wrong here?


Why Is This Not Working
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim DbasePath As String
Dim sql As String

DbasePath = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source= " & App.Path & "/movieguide.MDB"

Set cn = New ADODB.Connection
cn.Open DbasePath
Set rs = New ADODB.Recordset

sql = "DELETE FROM tblActor " & _
"WHERE tblActor.MovieID = " & lblCounter2.Caption & _
"AND tblActor.actor_ID = " & lblCntr3.Caption

Working With
I am using MSHFlexGrid with 4 columns.
When user double-clicks on certein cell (1 to 4), i wan to display in MSGBOX the value that in the first column of that row.

Thanks in advance

Add New Not Working
Can anyone explain to me why this is not working please, im using an SQL Server express database and get the error method add new failed



Set rs = New Recordset
rs.Open "Select * from Tbl_Actions", cn
With rs
.Fields("Action_Too") = "Test" & ""
.Fields("Complete") = "Test" & ""
.Fields("Action_Time") = "Test" & ""
.Fields("Action_Date") = "Test" & ""
.Fields("Result_Time") = "Test" & ""
.Fields("Result_Date") = "Test" & ""
.Fields("Priority") = "Test" & ""
.Fields("X_Ref") = "Test" & ""
End With
but this does

cn.Execute ("INSERT INTO Tbl_Actions" & _
"(Action_Too) VALUES('This is a test')")

LIKE Not Working For Me
I am working on an Inventry control something where I can return Records from a partial number search in my prog. Here is what the code looks like

Dim Cnn As New ADODB.Connection
Dim pCmd As New ADODB.Command
Dim pParam As New ADODB.Parameter
Dim rs As ADODB.Recordset
Dim sSQL As String
Dim sName As String

On Error GoTo Err
sName = "C:Stores.mdb"
pCmd.ActiveConnection = Cnn
Set pParam = pCmd.CreateParameter("[ PartNumber]", adVarChar, adParamInput, 50, "'v*'")
pCmd.Parameters.Append pParam
pCmd.CommandText = "components_query"
Set rs = pCmd.Execute(, , -1)
MsgBox rs(1).Value

Exit Function

MsgBox CStr(Err.Number) & ", " & Err.Description, vbOKOnly + vbCritical, App.Title

I am not returning anything. I have a Paramater Query in my database and it works fine. Can anyone see what I am doing wrong?


Why Is This API Not Working?
I have been pulling my hair our trying to figure out what's wrong with this. Basically, I am trying to get the physical drive on which a volume resides on. There's an API ( which gives you that info and it's working fine in VC++ but in VB6, it is not. Here's the relevant parts:


lowpart As Long
highpart As Long
End Type

DiskNumber As Long 'This is the data I am looking for
StartingOffset As LARGE_INTEGER
End Type

'This is the structure in which IOCTL will return data
NumberOfDiskExtents As Long
Extents(1) As DISK_EXTENT
End Type

'Here I call the IOCTL via Win32 API, passing it a valid volume handle
'obtained thru a successful CreateFile() Win32 API call

Public Function GetLogicaltoPhysicalMap(hDevice As Long) As VOLUME_DISK_EXTENTS
Dim bytesReturned As Long
Dim ret As Long


ret = DeviceIoControl(hDevice, _
ByVal 0&, _
0&, _
GetLogicaltoPhysicalMap, _
Len(GetLogicaltoPhysicalMap), _
bytesReturned, _
ByVal 0&)
End If
End Function

'Call above function elsewhere in code
VE = GetLogicaltoPhysicalMap(hDevice)

The DeviceIoControl() and other Win32 APIs in my code are legit because they are working fine in other circumstances. I am getting weird negative values inside the DISK_EXTENT structure. The only value which matches the VC++ returned values is StartingOffset.lowpart (this shows that the IOCTL call went OK). I have code for checking return value of DeviceIOControl() but I have taken it out for brevity. Also, I have tried using Currency instead of LARGE_INTEGER in the types above but to no avail.

I think there's some conversion issue or something here between the types but I can't figure out what. If anyone has suggestions or other input, I'll appreciate it.


Working With AIM 5
does anyone know a way to get a list of the names on your buddy list into vb? like.. a list to list transfer kinda thing? i've tried a few diffrent API calls but none of them worked because aim doesn't actually use a list it uses some type of tree or something, any help would be appreciated.

End? Not Working In .exe
I am using the following code to catch a particular error:

Private Sub Form_Load()
On Error Go To ConnErr
Exit Sub
MsgBox ("Error connecting to database, please check database path and try again.")
End Sub

So, what I want it to do it when an error occurs display this text box then END the application. When I run this by hitting the run button through VB this is exactly what happens when the error occurs. However, having compiled this project to an executable, when an error occurs the msgbox is shown but then instead of the program ending, it opens the form that would have been opened if an error hadn't of occured.

This is such a weird problem, anyone came accross it before? Any ideas as to solve it?

Thanks in advance.

Copyright 2005-08, All rights reserved