Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
VB Databases Basics Beginning-level VB coding questions specific to using VB with databases. Issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Databases Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 17th, 2008, 01:36 PM
Authorized User
 
Join Date: Aug 2008
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default help pls with connection string

can someone please help me with the code below, i am getting error "Expected )"

con.Provider = ("Microsoft.Jet.OLEDB.4.0;data source = " & App.Path & "\" & "vbox.mdb";Jet OLEDB:Database Password=qw34;Persist Security Info=False")

 
Old August 17th, 2008, 04:53 PM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

You have a " that is in a wrong position. the problem is "vbox.mdb"

the correct line should be:
con.Provider = "Microsoft.Jet.OLEDB.4.0;data source = " & App.Path & "\vbox.mdb;Jet OLEDB:Database Password=qw34;Persist Security Info=False"


HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
 
Old August 20th, 2008, 12:46 PM
Authorized User
 
Join Date: Aug 2008
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i did that but its still not working :(

 
Old August 20th, 2008, 12:50 PM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

what's the error now?

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
 
Old August 23rd, 2008, 06:28 AM
Authorized User
 
Join Date: Aug 2008
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

now i am getting "object required"

 
Old August 23rd, 2008, 02:14 PM
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

So show some code.

And indicate which line is getting the error.

Generally, you should show the line with the error and about 20 lines prior to it and maybe 4 or 5 lines after it.

Nobody can guess the cause of your error without seeing code.
 
Old August 23rd, 2008, 08:03 PM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

You are using VB what version??

maybe you are looking for another object.. maybe con.connectionstring???

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
 
Old August 24th, 2008, 04:52 AM
Authorized User
 
Join Date: Aug 2008
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Private Sub CommandButton1_Click()

Set con = CreateObject("ADODB.connection")
Set rs = CreateObject("ADODB.recordset")
Set cmd = CreateObject("ADODB.command")
con.Provider = ("Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Database Password=asd123;data source = " & App.Path & "\" & "vbox_db.mdb;Persist Security Info=False")
con.Open App.Path & "\vbox_db.mdb"

 
Old August 24th, 2008, 08:54 PM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

are you using vb script?

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
 
Old August 25th, 2008, 11:47 AM
Authorized User
 
Join Date: Aug 2008
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

vba





Similar Threads
Thread Thread Starter Forum Replies Last Post
Pls Help me count records [soon after connection] amjad_mahmood VB Databases Basics 1 August 30th, 2005 07:20 PM
PLS HELP ME ..STRING CONCATINATION rajukurian SQL Language 15 May 6th, 2005 05:47 PM
Connection String slgknjn VB Databases Basics 2 February 26th, 2005 03:14 AM
Connection String aadz5 JSP Basics 1 January 24th, 2005 04:36 AM
Connection string tlamazares SQL Server ASP 1 March 29th, 2004 05:16 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.