Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

OLEDB bind variable

3 posts in General Discussion Last posting was on 2004-07-27 10:08:37.0Z
Arno Posted on 2004-07-19 11:51:39.0Z
From: "Arno" <seitinger@4u2.com>
Newsgroups: ianywhere.public.general
Subject: OLEDB bind variable
Lines: 24
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
X-Original-NNTP-Posting-Host: 62.99.246.206
Message-ID: <40fbb6b4$1@forums-2-dub>
X-Original-Trace: 19 Jul 2004 04:55:32 -0700, 62.99.246.206
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 19 Jul 2004 04:45:12 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 19 Jul 2004 04:51:39 -0700
X-Trace: forums-1-dub 1090237899 10.22.108.75 (19 Jul 2004 04:51:39 -0700)
X-Original-Trace: 19 Jul 2004 04:51:39 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:3271
Article PK: 6725

Hi!

We use to connect to Sybase Anywhere 9.0.0.1108 oledb.
have someone a sample for using bind variables?
I prefer C++ samples.


for Oracle and MS the code looks like:
hr=m_zw->Create(session,sqlstr);

hr=m_zw->Prepare();

hr=m_zw->BindParameters(&m_zw->m_hParameterAccessor,m_zw->m_spCommand,&pDumm
y);

hr=m_zw->Open(NULL,NULL,0)

but with Sybase it doesn't work.

Thanks for any help

arno


Chris Keating (iAnywhere Solutions) Posted on 2004-07-21 12:00:13.0Z
From: "Chris Keating \(iAnywhere Solutions\)" <FightSpam_keating@iAnywhere.com>
Newsgroups: ianywhere.public.general
References: <40fbb6b4$1@forums-2-dub>
Subject: Re: OLEDB bind variable
Lines: 58
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: cpe0080c6f83676-cm012059936305.cpe.net.cable.rogers.com
X-Original-NNTP-Posting-Host: cpe0080c6f83676-cm012059936305.cpe.net.cable.rogers.com
Message-ID: <40fe5acd@forums-1-dub>
Date: 21 Jul 2004 05:00:13 -0700
X-Trace: forums-1-dub 1090411213 24.112.219.219 (21 Jul 2004 05:00:13 -0700)
X-Original-Trace: 21 Jul 2004 05:00:13 -0700, cpe0080c6f83676-cm012059936305.cpe.net.cable.rogers.com
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:3281
Article PK: 6734

There must be more to this as Ceate, Prepare, BindParameters are not OLEDB
methods AFAIK. It does not look to be MFCs CDatabase class. What is the
class/class libraries that you are using?
--

Chris Keating
Sybase Adaptive Server Anywhere Professional Version 8

****************************************************************************
*
Sign up today for your copy of the SQL Anywhere Studio 9 Developer Edition
and try out the market-leading database for mobile, embedded and small to
medium sized business environments for free!

http://www.ianywhere.com/promos/deved/index.html

****************************************************************************
*

iAnywhere Solutions http://www.iAnywhere.com

** Please only post to the newsgroup

** Whitepapers can be found at http://www.iAnywhere.com/developer
** EBFs can be found at http://downloads.sybase.com/swx/sdmain.stm
** Use CaseXpress to report bugs http://casexpress.sybase.com

****************************************************************************
*

"Arno" <seitinger@4u2.com> wrote in message news:40fbb6b4$1@forums-2-dub...
> Hi!
>
> We use to connect to Sybase Anywhere 9.0.0.1108 oledb.
> have someone a sample for using bind variables?
> I prefer C++ samples.
>
>
> for Oracle and MS the code looks like:
> hr=m_zw->Create(session,sqlstr);
>
> hr=m_zw->Prepare();
>
>
hr=m_zw->BindParameters(&m_zw->m_hParameterAccessor,m_zw->m_spCommand,&pDumm
> y);
>
> hr=m_zw->Open(NULL,NULL,0)
>
> but with Sybase it doesn't work.
>
> Thanks for any help
>
> arno
>
>


Arno Posted on 2004-07-27 10:08:37.0Z
From: "Arno" <seitinger@4u2.com>
Newsgroups: ianywhere.public.general
References: <40fbb6b4$1@forums-2-dub> <40fe5acd@forums-1-dub>
Subject: Re: OLEDB bind variable
Lines: 129
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
X-Original-NNTP-Posting-Host: 62.99.246.206
Message-ID: <41062aaa$1@forums-2-dub>
X-Original-Trace: 27 Jul 2004 03:12:58 -0700, 62.99.246.206
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 27 Jul 2004 03:01:23 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 27 Jul 2004 03:08:37 -0700
X-Trace: forums-1-dub 1090922917 10.22.108.75 (27 Jul 2004 03:08:37 -0700)
X-Original-Trace: 27 Jul 2004 03:08:37 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:3320
Article PK: 7228

Hi Chris,

our code looks like:

CCommand <CDynamicParameterAccessor,CNoRowset,CNoMultipleResults>
*m_zw[MAXSTRZANZAHL];

BOOL ADb::WriteStrzDaten(double *w, int Anzahl, int OrgId, int ZeitId, int
Liste) {
CString s,s1;
HRESULT hr;
int i;
BOOL ret=true;
void *pDummy;

CSession *sess=&m_session;
if(!m_zw[Liste])
{
s.Format(_T("UPDATE %s_Z%03d SET "),m_Prefix,Liste);
for(i=0;i<Anzahl;i++)
{
s1.Format(_T("F%03d = ?"),i);
s+=s1;if(i<(Anzahl-1))s+=_T(",");
}
s+=(_T(" WHERE sId=? AND zId=? "));
m_zw[Liste]=new CCommand
<CDynamicParameterAccessor,CNoRowset,CNoMultipleResults>;
if(FAILED(hr=m_zw[Liste]->Create(*sess,s)))
{
ret=_Error1(hr,_T("ADb::WriteStrzDaten Create"));
return ret;
}
if(FAILED(hr=m_zw[Liste]->Prepare()))
{
ret=_Error1(hr,_T("ADb::WriteStrzDaten Prepare"));
return ret;
}

if(FAILED(hr=m_zw[Liste]->BindParameters(&m_zw[Liste]->m_hParameterAccessor,
m_zw[Liste]->m_spCommand,&pDummy)))
{
ret=_Error1(hr,_T("ADb::WriteStrzDaten BindParameters"));
return ret;
}
}

for(i=0;i<Anzahl;i++)
m_zw[Liste]->SetParam((ULONG)i+1,&w[i]);
m_zw[Liste]->SetParam((ULONG)Anzahl+1,&OrgId);
m_zw[Liste]->SetParam((ULONG)Anzahl+2,&ZeitId);
if(FAILED(hr=m_zw[Liste]->Open(NULL,NULL,0)))
{
ret=_Error1(hr,_T("ADb::WriteStrzDaten Open"));
return ret;
}

return ret;
}

arno


"Chris Keating (iAnywhere Solutions)" <FightSpam_keating@iAnywhere.com>

wrote in message news:40fe5acd@forums-1-dub...
> There must be more to this as Ceate, Prepare, BindParameters are not OLEDB
> methods AFAIK. It does not look to be MFCs CDatabase class. What is the
> class/class libraries that you are using?
> --
>
> Chris Keating
> Sybase Adaptive Server Anywhere Professional Version 8
>
>
****************************************************************************
> *
> Sign up today for your copy of the SQL Anywhere Studio 9 Developer Edition
> and try out the market-leading database for mobile, embedded and small to
> medium sized business environments for free!
>
> http://www.ianywhere.com/promos/deved/index.html
>
>
****************************************************************************
> *
>
> iAnywhere Solutions http://www.iAnywhere.com
>
> ** Please only post to the newsgroup
>
> ** Whitepapers can be found at http://www.iAnywhere.com/developer
> ** EBFs can be found at http://downloads.sybase.com/swx/sdmain.stm
> ** Use CaseXpress to report bugs http://casexpress.sybase.com
>
>
****************************************************************************
> *
>
> "Arno" <seitinger@4u2.com> wrote in message
news:40fbb6b4$1@forums-2-dub...
> > Hi!
> >
> > We use to connect to Sybase Anywhere 9.0.0.1108 oledb.
> > have someone a sample for using bind variables?
> > I prefer C++ samples.
> >
> >
> > for Oracle and MS the code looks like:
> > hr=m_zw->Create(session,sqlstr);
> >
> > hr=m_zw->Prepare();
> >
> >
>
hr=m_zw->BindParameters(&m_zw->m_hParameterAccessor,m_zw->m_spCommand,&pDumm
> > y);
> >
> > hr=m_zw->Open(NULL,NULL,0)
> >
> > but with Sybase it doesn't work.
> >
> > Thanks for any help
> >
> > arno
> >
> >
>
>