Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Microsoft sql server compact edition oledb provider
Message
 
À
16/02/2009 17:29:16
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP1
Network:
Windows XP
Divers
Thread ID:
01382195
Message ID:
01382214
Vues:
45
>>>>>>Hi All,
>>>>>>i've a problem about connection to microsoft sql server compact edition via oledb provider.i've allready registered sqlceoledb35.dll
>>>>>>but i am getting error :( "ole dispatch exception code 0 from SQL Server Compact OLEDB Provider : ?.. "
>>>>>>
>>>>>>at lnConn=osqlce.Open() line
>>>>>>
>>>>>>where is my mistake ?
>>>>>>
>>>>>>TIA
>>>>>>
>>>>>>here is my trying codes
>>>>>>
>>>>>>
>>>>>>Local lcLocalConnectionstring As String Pretext 8
>>>>>>TEXT TO lcLocalConnectionstring NOSHOW
>>>>>>Provider=Microsoft.SQLSERVER.CE.OLEDB.3.5;
>>>>>>Data Source=d:\soykan.sdf;
>>>>>>Mode=ReadWrite|Share Deny None;
>>>>>>SSCE:Max Buffer Size=640;
>>>>>>SSCE:Database Password='';
>>>>>>SSCE:Encrypt Database=False;
>>>>>>SSCE:Default Lock Escalation=100;
>>>>>>SSCE:Temp File Directory="";
>>>>>>SSCE:Default Lock Timeout=5000;
>>>>>>SSCE:AutoShrink Threshold=60;
>>>>>>SSCE:Flush Interval=10;
>>>>>>SSCE:Test Callback Pointer=0;
>>>>>>SSCE:Max Database Size=512;
>>>>>>SSCE:Temp File Max Size=128
>>>>>>ENDTEXT
>>>>>>
>>>>>>Local osqlce As adodb.Connection
>>>>>>osqlce=Createobject('ADODB.Connection')
>>>>>>osqlce.ConnectionString=lcLocalConnectionstring
>>>>>>lnConn=osqlce.Open()
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>http://connectionstrings.com/sql-server-2005-ce
>>>>>
>>>>>Try first w/oextra options:
>>>>>
>>>>>TEXT TO lcLocalConnectionstring NOSHOW PRETEXT 15 && PRETEXT also :-)
>>>>>Provider=Microsoft.SQLSERVER.CE.OLEDB.3.5;
>>>>>Data Source=d:\soykan.sdf;
>>>>>ENDTEXT
>>>>>...
>>>>>
>>>>
>>>>Hi Boris,
>>>>i've tried as your suggest w/o extra options buts still same :(
>>>
>>>hmmm,
>>>and how about all options but with PRETEXT?
>>
>>last state
>>
>>Local lcLocalConnectionstring As String Pretext 15 &&8
>>TEXT TO lcLocalConnectionstring NOSHOW
>>Provider=Microsoft.SQLSERVER.CE.OLEDB.3.5
>>Data Source=d:\soykan.sdf
>>ENDTEXT
>>
>>Local osqlce As adodb.Connection
>>osqlce=Createobject('ADODB.Connection')
>>osqlce.ConnectionString=lcLocalConnectionstring
>>lnConn=osqlce.Open()
>>
>>
>>error : not found may be not properly installed ughh :(
>
>Why are you using text...endtext. It is very easy to make errors in connection string build using text...endtext. This works well for me:
>
>clear
>lcLocalConnectionstring = ;
>  "Provider=Microsoft.SQLSERVER.CE.OLEDB.3.5;"+;
>  "Data Source=C:\Program Files\Microsoft SQL Server Compact Edition\v3.5\Samples\northwind.sdf"
>
>Local osqlce As adodb.Connection
>osqlce=Createobject('ADODB.Connection')
>osqlce.ConnectionString=lcLocalConnectionstring
>osqlce.Open()
>
>Local loCommand As adodb.Command
>loCommand = Createobject("adodb.command")
>loCommand.CommandText = "select * from customers"
>loCommand.ActiveConnection = osqlce
>loRS = loCommand.Execute()
>
>
>Do While !loRS.Eof
>  ? loRS.Fields(0).Value
>  loRS.movenext()
>Enddo
>
>osqlce.Close()
Cetin

Yes :) your sample works for me too... how would be the using CursorAdapter showing records at browse window
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform