Article View: be.comp.programming
Article #7460Run-time error 430 in VB
From: Tom
Date: Tue, 03 Sep 2002 13:00
Date: Tue, 03 Sep 2002 13:00
125 lines
5790 bytes
5790 bytes
Op mijn PC, waar ik de applicatie heb geschreven en gecompileerd, werkt het
programma perfect. Als er op de knop 'opslaan' wordt geklikt, wordt de
inhoud van de tekstvakken naar een database geschreven (via een udl-file
naar een Access-database).
Als ik het programma echter run op de PC van mijn vader, krijg ik, wanneer
ik op de knop 'opslaan' klik, een runtime error 430. Class doesn't support
Automation.
Enig idee wat ik moet doen om dit aan de praat te krijgen?
Bedankt
PS : Dit is het stukje code na het klikken op 'opslaan'. Misschien helpt
dit.
Private Sub cmdOpslaan_Click()
Dim Answer As VbMsgBoxResult
Dim sSQL As String
Dim rsNummer As ADODB.Recordset
Dim sZoekWaarde As String
sZoekWaarde = txtNummer.Text
sSQL = "SELECT * FROM Main WHERE Nummer='" & sZoekWaarde & "'"
Set rsNummer = Getrs(sSQL)
If rsNummer.RecordCount = 0 Then
Answer = MsgBox("De opdracht opslaan?", vbYesNo, "Opslaan?")
If Answer = vbYes Then
sSQL = "INSERT INTO Main (Nummer, DatumAanvraag, KlantNaam,
KlantStraat, KlantPostcode, "
sSQL = sSQL & "KlantGemeente, KlantTelNr, KlantGSM, SiteType,
TypeGebouw, Situatie, "
sSQL = sSQL & "Informatiebron, CommentaarBelgacom, LeadEmployee,
ResultVerCall, "
sSQL = sSQL & "CommentaarMetasafe, Verkoper, DatumLangs) VALUES
('"
sSQL = sSQL & txtNummer.Text & "', '"
sSQL = sSQL & txtDatumAanvraag.Text & "', '"
sSQL = sSQL & txtNaam.Text & "', '"
sSQL = sSQL & txtStraat.Text & "', '"
sSQL = sSQL & txtPostcode.Text & "', '"
sSQL = sSQL & txtGemeente.Text & "', '"
sSQL = sSQL & txtTelNr.Text & "', '"
sSQL = sSQL & txtGsm.Text & "', '"
sSQL = sSQL & txtType.Text & "', '"
sSQL = sSQL & txtGebouw.Text & "', '"
sSQL = sSQL & txtSituatie.Text & "', '"
sSQL = sSQL & txtInformatieBron.Text & "', '"
sSQL = sSQL & rtbCommBelgacom.Text & "', '"
sSQL = sSQL & txtLead.Text & "', '"
sSQL = sSQL & txtResult.Text & "', '"
sSQL = sSQL & rtbCommMS.Text & "', '"
sSQL = sSQL & txtVerkoper.Text & "', '"
sSQL = sSQL & txtDatumLangs.Text & "');"
gadoCon.Execute (sSQL)
AllesWissen
End If
Else
If rsNummer.Fields.Item("Nummer").Value = txtNummer.Text Then
Answer = MsgBox("De huidige opdracht (" & txtNummer.Text & ")
overschrijven?", vbYesNo, "Overschrijven?")
If Answer = vbYes Then
sSQL = "UPDATE Main SET DatumAanvraag='" &
txtDatumAanvraag.Text & "', "
sSQL = sSQL & "KlantNaam='" & txtNaam.Text & "', "
sSQL = sSQL & "KlantStraat='" & txtStraat.Text & "', "
sSQL = sSQL & "KlantPostcode='" & txtPostcode.Text & "', "
sSQL = sSQL & "KlantGemeente='" & txtGemeente.Text & "', "
sSQL = sSQL & "KlantTelNr='" & txtTelNr.Text & "', "
sSQL = sSQL & "KlantGSM='" & txtGsm.Text & "', "
sSQL = sSQL & "SiteType='" & txtType.Text & "', "
sSQL = sSQL & "TypeGebouw='" & txtGebouw.Text & "', "
sSQL = sSQL & "Situatie='" & txtSituatie.Text & "', "
sSQL = sSQL & "Informatiebron='" & txtInformatieBron.Text &
"', "
sSQL = sSQL & "CommentaarBelgacom='" & rtbCommBelgacom.Text
& "', "
sSQL = sSQL & "LeadEmployee='" & txtLead.Text & "', "
sSQL = sSQL & "ResultVerCall='" & txtResult.Text & "', "
sSQL = sSQL & "CommentaarMetasafe='" & rtbCommMS.Text & "',
"
sSQL = sSQL & "Verkoper='" & txtVerkoper.Text & "', "
sSQL = sSQL & "DatumLangs='" & txtDatumLangs.Text & "' WHERE
"
sSQL = sSQL & "Nummer = '" & sZoekWaarde & "'"
gadoCon.Execute (sSQL)
AllesWissen
End If
End If
End If
End Sub
en dit staat in een aparte module, Adofuncties.bas :
Public gadoCon As New ADODB.Connection
Public Sub OpenConnectie()
gadoCon.Open "file name=" & App.Path & "\" & Dir(App.Path & "\*.udl")
End Sub
Public Sub SluitConnectie()
gadoCon.Close
End Sub
Public Function Getrs(sSQL As String) As ADODB.Recordset
Dim rs As New ADODB.Recordset
rs.Open sSQL, gadoCon, adOpenStatic
If Not (rs.BOF And rs.EOF) Then
rs.MoveFirst
End If
Set Getrs = rs
End Function
Technical Details
Message-ID:
<pn2d9.100556$8o4.14120@afrodite.telenet-ops.be>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-xit-04!supernews.com!diablo.theplanet.net!kibo.news.demon.net!demon!newshub1.nl.home.com!news.nl.home.com!amsnews01.chello.com!news-hub.cableinet.net!blueyonder!btnet-peer!btnet!newsfeed.london1.eu.level3.net!level3eu!ossa.telenet-ops.be!afrodite.telenet-ops.be.POSTED!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: DUTCH,ASCII-7-bit X-Google-Thread: fcea4,8c55d160bebf9328,start X-Google-Attributes: gidfcea4,public X-Google-ArrivalTime: 2002-09-03 06:03:03 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-xit-04!supernews.com!diablo.theplanet.net!kibo.news.demon.net!demon!newshub1.nl.home.com!news.nl.home.com!amsnews01.chello.com!news-hub.cableinet.net!blueyonder!btnet-peer!btnet!newsfeed.london1.eu.level3.net!level3eu!ossa.telenet-ops.be!afrodite.telenet-ops.be.POSTED!not-for-mail From: "Tom" <xfile23@hotmail.com> Newsgroups: be.comp.programming Subject: Run-time error 430 in VB Lines: 127 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Message-ID: <pn2d9.100556$8o4.14120@afrodite.telenet-ops.be> Date: Tue, 03 Sep 2002 13:00:05 GMT NNTP-Posting-Host: 213.119.148.171 X-Complaints-To: abuse@telenet.be X-Trace: afrodite.telenet-ops.be 1031058005 213.119.148.171 (Tue, 03 Sep 2002 15:00:05 MET DST) NNTP-Posting-Date: Tue, 03 Sep 2002 15:00:05 MET DST Organization: Telenet Internet