DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Thu, 09 Aug 2007 13:17:11 -0700,    posted on: microsoft.public.dotnet.academic        back       

Thread Index
  1    slinky
          2    pvdg42 am


.aspx.vb syntax problem   
I'm making a OLE DB connection in code and was wondering if anyone
could identify what the syntax errors would be in this just as it is
pasted (I tried putting   & _  at the end of the first line and that
only brought up other errors):

New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data & _
Source=" & Server.MapPath("~/App_Data/Lowes.mdb") & ";" & _
"Initial Catalog=Assets;Integrated Security=SSPI")

another variation I've tried is:

New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
_
Server.MapPath("~/App_Data/Lowes.mdb") " &";Initial & _
Catalog=Assets;Integrated Security=SSPI")


Any ideas?   Thanks!!!!!
Date:Thu, 09 Aug 2007 13:17:11 -0700   Author:  

Re: .aspx.vb syntax problem   
"slinky"  wrote in message 
news:1186690631.326403.44090@x35g2000prf.googlegroups.com...

> I'm making a OLE DB connection in code and was wondering if anyone
> could identify what the syntax errors would be in this just as it is
> pasted (I tried putting   & _  at the end of the first line and that
> only brought up other errors):
>
> New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data & _
> Source=" & Server.MapPath("~/App_Data/Lowes.mdb") & ";" & _
> "Initial Catalog=Assets;Integrated Security=SSPI")
>
> another variation I've tried is:
>
> New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
> _
> Server.MapPath("~/App_Data/Lowes.mdb") " &";Initial & _
> Catalog=Assets;Integrated Security=SSPI")
>
>
> Any ideas?   Thanks!!!!!
>

Your basic problem is that you need to properly embed quotqtion marks within 
the string you're trying to create. One way to do this is illustrated by the 
connection string created when creating a Data Connection:

connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data 
Source="C:\CIT1713_Murach2005_IRK\ASP20\Project 
databases\TechSupport.mdb""

providerName="System.Data.OleDb" />

The above is XML. The article below will help you with the 
Microsoft.VisualBasic.ControlChars class and how to create an embeddable 
quote character:

http://msdn2.microsoft.com/en-us/library/microsoft.visualbasic.controlchars.quote.aspx
Date:Thu, 9 Aug 2007 16:21:45 -0500   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us