473,405 Members | 2,272 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

solve the error

284 100+
i am using vb6 and crystal report ten ms access 2003

i had made a password in my access .now when i uses the following code its give me error that invalid password
i am filtering the crystal report with the following code

Expand|Select|Wrap|Line Numbers
  1.  
  2. invoicerep.SQLQueryString = "select * from salessummary where [invoice no]=" & invnotxt & ""
  3.  
so how to correct the code to open query in password protected access
May 25 '08 #1
4 1623
lotus18
866 512MB
i am using vb6 and crystal report ten ms access 2003

i had made a password in my access .now when i uses the following code its give me error that invalid password
i am filtering the crystal report with the following code

Expand|Select|Wrap|Line Numbers
  1.  
  2. invoicerep.SQLQueryString = "select * from salessummary where [invoice no]=" & invnotxt & ""
  3.  
so how to correct the code to open query in password protected access
Hi

As much as possible, avoid spaces with your fieldname and I removed the extra & "".

Expand|Select|Wrap|Line Numbers
  1.  invoicerep.SQLQueryString = "select * from salessummary where [invoice_no]=" & invnotxt 
May I see your codes for setting your access connection.

Rey Sean
May 25 '08 #2
QVeen72
1,445 Expert 1GB
Hi,

If you have newly created the Password to Access Db, then you need to pass password in to the crystal report(Thru connect property)..
Which version of CR..?

Regards
Veena
May 26 '08 #3
muddasirmunir
284 100+
i am using crystal report 10

now if i removed the password the code works fine and show no error

but if i made password to access then this code show error.
the error is

Expand|Select|Wrap|Line Numbers
  1.  Run time error 
  2.  
  3. Logno failed
  4. Details DAO Error code: 0xbd7
  5. Source DAO Workspace
  6. Description Not a valid password
  7.  


the code for connecting to acces (i made a connection in module as
public)

Expand|Select|Wrap|Line Numbers
  1. Set con = New Connection
  2. Dim datapath As String
  3. datapath = App.path & "\Orders.mdb"
  4. con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source= " & datapath & ";Persist Security Info=False; Jet OLEDB:Database Password=mypasword"
and code for filtering crystal report query is

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2. Screen.MousePointer = vbHourglass
  3. invoicerep.SQLQueryString = "select * from salessummary where [invoice no]=" & invoicefil.invnotxt & ""
  4. CRViewer1.ReportSource = invoicerep
  5. CRViewer1.ViewReport
  6. CRViewer1.DisplayTabs = False
  7. Screen.MousePointer = vbDefault
  8. End Sub
  9.  
when i click on dubug the code i was pointed to the following field
Expand|Select|Wrap|Line Numbers
  1. invoicerep.SQLQueryString = "select * from salessummary where [invoice no]=" & invoicefil.invnotxt & ""
remember in crystal report desingner using database expert
when i made a connection to acces i give password to it
can you solve what is the error now or what thing i am missing











Hi,

If you have newly created the Password to Access Db, then you need to pass password in to the crystal report(Thru connect property)..
Which version of CR..?

Regards
Veena
May 26 '08 #4
QVeen72
1,445 Expert 1GB
Hi,

You need to set password info to CR.
This works for CR 9, any way you can try it..

Expand|Select|Wrap|Line Numbers
  1. dim MyCr As CRAXDRT.ConnectionProperties
  2. Screen.MousePointer = vbHourglass
  3. Set MyCr =invoicerep.Database.Tables.Item(1).ConnectionProperties
  4. MyCr("Password") = "MyPassWord"
  5. invoicerep.SQLQueryString = "select * from salessummary where [invoice no]=" & invoicefil.invnotxt & ""
  6. CRViewer1.ReportSource = invoicerep
  7. CRViewer1.ViewReport
  8. CRViewer1.DisplayTabs = False
  9. Screen.MousePointer = vbDefault
  10.  
Regards
Veena
May 26 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Koen | last post by:
Hi all, I created a little database to manage my e-books. The program will synchronize a table with the contents of a directory. Works great. Because I keep additional info (like keywords) to...
8
by: MyAlias | last post by:
Can't solve this CallBack returning structures Error message: An unhandled exception of type 'System.NullReferenceException' occurred in MyTest.exe Additional information: Object reference not...
1
by: arun | last post by:
Query is too complex -------------------------------------------------------------------------------- Hi, I was trying to solve this problem since last two days but couldn't find any solution. ...
9
by: fcvcnet | last post by:
Hi, I write a class class CSegment { public: CSegment(void); public: ~CSegment(void); public: CArray< CList< CPoint, CPoint& >, CList< CPoint, CPoint& >& m_curve;
2
by: katrinkerber | last post by:
Hello, I need help to solve a runtime error that keeps reocurring every time I try to convert an Excel file into an Acess File. I have looked through many forums trying to find help, but I have...
4
by: namalapavan | last post by:
hii , i am getting and error while installing oracle9i on RHEL AS 4.0 .i am sure that somebody here would be able to solve my problem.kindly reply so that i can send you the detailed error report....
17
by: Michael Reichenbach | last post by:
Here is the example code. int main(int argc, char *argv) { string Result; WIN32_FIND_DATA daten; HANDLE h = FindFirstFile(TEXT("c://test"), &daten); system("PAUSE"); return EXIT_SUCCESS; }
3
by: thalinx | last post by:
Hi can ayone help me with this program, cause i dont know how to solve the compiling errors here. thanks # include<stdlib.h> # include<conio.h> # include<stdio.h> # define MAXCADENA 8 # define...
7
by: akmaRudiliyn | last post by:
Hai everybody :). I have problem and need help. ERROR: ERROR Violation of PRIMARY KEY constraint 'PK_Table1_01'. Cannot insert duplicate key in object 'dbo.table1'. ERROR The statement has...
1
by: Ryan Liu | last post by:
Hi, I have a 100 clients/ one server application, use ugly one thread pre client approach. And both side user sync I/O. I frequently see the error on server side(client side code is same, but...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.