Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Type mismatch: ’openDb’ ?!
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Type mismatch: ’openDb’ ?!

 Post Reply Post Reply
Author
Lucent View Drop Down
Groupie
Groupie


Joined: 06 June 2003
Status: Offline
Points: 111
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lucent Quote  Post ReplyReply Direct Link To This Post Topic: Type mismatch: ’openDb’ ?!
    Posted: 01 July 2003 at 1:14pm

Hi,

I have this asp dynamic mean script and trying to put it on my website. I got this error message, can anyone tell me how to fix it? thank you.

line 180 is

call openDb()

Does it look like I need to write something in the () ?

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

Microsoft VBScript runtime error '800a000d'

Type mismatch: 'openDb'

line 180

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

Back to Top
aero View Drop Down
Groupie
Groupie
Avatar

Joined: 21 May 2003
Location: Denmark
Status: Offline
Points: 80
Post Options Post Options   Thanks (0) Thanks(0)   Quote aero Quote  Post ReplyReply Direct Link To This Post Posted: 01 July 2003 at 1:43pm

HI.

If U have made a site whit U'r DB connection in a inklude file U have to inklude the site om that site where U want to inklude the file !!

U'r inklude site can look like this:

<%

Dim objConn

Sub OpenDataBase(strDBPath)
 
  Dim strProvider

  strProvider = ""
  strProvider = strProvider & "Provider=Microsoft.Jet.OLEDB.4.0;"
 strProvider = strProvider & "Data Source=" & strDBPath & ";"
  strProvider = strProvider & "Persist Security Info=False"
  Set objConn = Server.CreateObject("ADODB.Connection")
  objConn.Open strProvider
 
End Sub

Sub CloseDataBase
 
  objConn.Close
  Set objConn = Nothing
End Sub

%>

Sub OpenDataBase(strDBPath)
is U'r connection whitout the place where U'r db is !!!

Sub CloseDataBase
is the funktion that close U'r connection/db !!!!

In U'r site where u have the inklude file U have a code that look like U'rs

Call OpenDataBase()

OPENDATABASE is like the SUB name in the connection site But U will get an error because U don't have write where U/the site can find the DB som changes the Call OpenDataBase() to:

Call OpenDataBase("d:\web\aspsoftware.dk\www\aero\aero.mdb")

Then the site will work and kan find the DB and remember the close funktion in u'r connection site Sub CloseDataBase !!!

Call CloseDataBase    U have to write this in u'r bottom of u'r site !!!

Hope U understand my english and that this will help U !!

 

Back to Top
Lucent View Drop Down
Groupie
Groupie


Joined: 06 June 2003
Status: Offline
Points: 111
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lucent Quote  Post ReplyReply Direct Link To This Post Posted: 01 July 2003 at 4:34pm

since I use DSN string, is this what I should do?

Call OpenDataBase("DSN=mydb.mdb")

Do I have to do the same for closing too?

Call CloseDataBase("DSN=mydb.mdb")

thank you for your help!!   

Back to Top
aero View Drop Down
Groupie
Groupie
Avatar

Joined: 21 May 2003
Location: Denmark
Status: Offline
Points: 80
Post Options Post Options   Thanks (0) Thanks(0)   Quote aero Quote  Post ReplyReply Direct Link To This Post Posted: 01 July 2003 at 4:37pm

no

Call OpenDataBase("U'r connection road")

Call CloseDataBase 

DSN shut be in the connection site !!!

Back to Top
Lucent View Drop Down
Groupie
Groupie


Joined: 06 June 2003
Status: Offline
Points: 111
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lucent Quote  Post ReplyReply Direct Link To This Post Posted: 01 July 2003 at 5:06pm
wouldn't that be unsafe to my database? ppl could easily see it
Back to Top
aero View Drop Down
Groupie
Groupie
Avatar

Joined: 21 May 2003
Location: Denmark
Status: Offline
Points: 80
Post Options Post Options   Thanks (0) Thanks(0)   Quote aero Quote  Post ReplyReply Direct Link To This Post Posted: 01 July 2003 at 5:45pm

No I use that script !!

Or I use the script like this:

MY connecting site:

<%
Dim connStr

Sub OpenDB

        connStr = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source="
        connStr = connStr & Server.MapPath("../nyhedscript/db/db.mdb")
          
End Sub

Sub CloseDB
 
  rs.Close
  Set rs = Nothing
End Sub

%>


My site that will show something from the DB

TOP:
<!--#include file="u'r connectsite.asp"-->

CONNECT:
Call OpenDB
Set rs = Server.CreateObject("ADODB.Recordset")

rs.Open "select [Name],[Age] from TEST " & _
  "ORDER BY [Id] DESC", connStr, 3, 4

U'R CODE and then:
Call CloseDB

IT works for me !!! 

 

Back to Top
the boss View Drop Down
Senior Member
Senior Member
Avatar

Joined: 19 January 2003
Location: Saudi Arabia
Status: Offline
Points: 1727
Post Options Post Options   Thanks (0) Thanks(0)   Quote the boss Quote  Post ReplyReply Direct Link To This Post Posted: 01 July 2003 at 5:47pm
no one would see the path to ur databaase.. asp is pased on the server and the asp code is not accessible to the client
Back to Top
aero View Drop Down
Groupie
Groupie
Avatar

Joined: 21 May 2003
Location: Denmark
Status: Offline
Points: 80
Post Options Post Options   Thanks (0) Thanks(0)   Quote aero Quote  Post ReplyReply Direct Link To This Post Posted: 22 July 2003 at 7:44pm

Hi. If U want 2 know more about:

- call openDb()
- Sub OpenDB

then I can recommend this good site and the site owner is also the code master 2 this EX. and have made the EX.

http://www.futte.dk/

klik on "Kode Eksempler" and the on "Database Connection til Access databaseer"  then U can se an EX.

BUT the site is in DANISH but have some good EX. !!!!!

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.