ConectionString of DataAdapter 
Author Message
 ConectionString of DataAdapter

I change the assignment of sqlconnection1.ConnectionString
to a global constant 'StrConnection' in code window:

Me.SqlConnection1.ConnectionString = StrConnection.

Task List Window will give warning message:
The variable'StrConnection1' is either undeclare or was
never assigned.

Can I get rid of it?



Sun, 06 Feb 2005 23:31:11 GMT  
 ConectionString of DataAdapter

Quote:
> I change the assignment of sqlconnection1.ConnectionString
> to a global constant 'StrConnection' in code window:

> Me.SqlConnection1.ConnectionString = StrConnection.

> Task List Window will give warning message:
> The variable'StrConnection1' is either undeclare or was
> never assigned.

> Can I get rid of it?

Where and how (line of code) is StrConnection declared? Do you use Option
Expicit On?

Armin



Mon, 07 Feb 2005 01:11:23 GMT  
 ConectionString of DataAdapter
It declare on a standard Modelue
with
Option Strict Off
Option Explicit On

    Public Const StrConnection = "data source=Loc;initial
catalog=Post;persist security info=False;user id" & _
        "=sa;password=XXXX;workstation id=Loc;packet
size=4096"

Quote:
>-----Original Message-----

schrieb
>> I change the assignment of

sqlconnection1.ConnectionString
Quote:
>> to a global constant 'StrConnection' in code window:

>> Me.SqlConnection1.ConnectionString = StrConnection.

>> Task List Window will give warning message:
>> The variable'StrConnection1' is either undeclare or was
>> never assigned.

>> Can I get rid of it?

>Where and how (line of code) is StrConnection declared?
Do you use Option
>Expicit On?

>Armin

>.



Mon, 07 Feb 2005 01:46:14 GMT  
 ConectionString of DataAdapter

Quote:
> It declare on a standard Modelue
> with
> Option Strict Off
> Option Explicit On

>     Public Const StrConnection = "data source=Loc;initial
> catalog=Post;persist security info=False;user id" & _
>         "=sa;password=XXXX;workstation id=Loc;packet
> size=4096"

Please switch Option Strict On in all files or remove the line and set it
for the whole project.

Quote:
> > Me.SqlConnection1.ConnectionString = StrConnection.

You wrote that
"The variable'StrConnection1' is either undeclare or was
never assigned."

Are you sure it's strConnection1 and not SQLConnection1? Right-click on
SqlConnection1 and select "go to definition".

Armin



Mon, 07 Feb 2005 02:05:06 GMT  
 ConectionString of DataAdapter
After switch Option Strict On in all files and remove the
line and set Option Strict On for the whole project.

The warning message still there

Public Const StrConnection as string = "data
source=Loc;initial ...

Quote:
>-----Original Message-----

>> It declare on a standard Modelue
>> with
>> Option Strict Off
>> Option Explicit On

>>     Public Const StrConnection = "data
source=Loc;initial
>> catalog=Post;persist security info=False;user id" & _
>>         "=sa;password=XXXX;workstation id=Loc;packet
>> size=4096"

>Please switch Option Strict On in all files or remove the
line and set it
>for the whole project.

>> > Me.SqlConnection1.ConnectionString = StrConnection.

>You wrote that
>"The variable'StrConnection1' is either undeclare or was
>never assigned."

>Are you sure it's strConnection1 and not SQLConnection1?
Right-click on
>SqlConnection1 and select "go to definition".

>Armin

>.



Wed, 09 Feb 2005 00:17:45 GMT  
 ConectionString of DataAdapter


Quote:
> After switch Option Strict On in all files and remove the
> line and set Option Strict On for the whole project.

> The warning message still there

> Public Const StrConnection as string = "data
> source=Loc;initial ...

My other question was, if really StrConnection is missing or SqlConnection1.
It's confusing because you wrote that 'StrConnection1' is missing. Of
course, it's missing, but it's not even used so could you please copy&paste
the real error message?

Armin



Wed, 09 Feb 2005 01:59:43 GMT  
 ConectionString of DataAdapter
I am sorry the declare statement is
Public Const StrConnection1 as string = "data
source=Loc;initial ...

The project can be compiled.
The warnning message in Task List Window annoy

Quote:
>-----Original Message-----


>> After switch Option Strict On in all files and remove
the
>> line and set Option Strict On for the whole project.

>> The warning message still there

>> Public Const StrConnection as string = "data
>> source=Loc;initial ...

>My other question was, if really StrConnection is missing
or SqlConnection1.
>It's confusing because you wrote that 'StrConnection1' is
missing. Of
>course, it's missing, but it's not even used so could you
please copy&paste
>the real error message?

>Armin

>.



Wed, 09 Feb 2005 04:51:48 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Select statement in dataAdapter

2. OLE DataAdapter & SQL error

3. DataAdapter Accessible from more than one form

4. DataAdapter & Combobox's

5. DataAdapter & combobox

6. DataAdapter

7. Simple Q: DataSet DataAdapter EFail

8. Unable to create DataAdapter object

9. How to fill my Typed DataSet with DataAdapter?

10. Reference a Forms Textbox from a DataAdapter

11. DataAdapter SelectCommand

12. Using DataAdapter and DataSet

 

 
Powered by phpBB® Forum Software